codex-team / codex-team/editor.js
[Bug] If Block Tune changes Block content, selection is lost
- Dominant language
- TypeScript
- Stars
- 31.9k
- Forks
- 2.2k
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 1
Description
At the moment `SelectionUtils#save` method saves the current range to use it for selection restore. Range object stores a link to an HTML element, however, if the element was removed or replaced, the selection can't be restored.
Steps to reproduce:
1. Set focus to Header Block
2. Press tab to open Block Settings
3. Choose header level different to the current one via keyboard and press enter
4. Selection is lost and there is a warning in console `The given range isn't in document.`
Expected behavior:
Cursor should stay at the same place
Editor.js version: 2.18
Plugins you use with their versions: Header v2.4.1
Possible solution: save element location and range offset some other way then just saving the Range object
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.