mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-30 02:19:52 +02:00
When resolving a slate Point from a DOM selection (toSlatePoint), consider that a node is only void if it's within the same editor that is resolving the Point. (#4885)
If you have a nested editor setup. For example, one editor has a void node that contains another editor. In this case, a resolution of a selection by the nested editor previously would consider that the selection is for a void node since an ancestor void node does exist. However, this selection is only a void node in the context of this editor if the ancestor void node is contained in the editor.
This commit is contained in:
7
.changeset/fuzzy-teachers-develop.md
Normal file
7
.changeset/fuzzy-teachers-develop.md
Normal file
@@ -0,0 +1,7 @@
|
||||
---
|
||||
'slate-react': patch
|
||||
---
|
||||
|
||||
toSlatePoint should not consider a selection within a void node if the void node isn't in the editor itself.
|
||||
|
||||
Prior to this fix, a nested Slate editor inside a void node in a parent editor would not allow you to start typing text in a blank editor state correctly. After the first character insertion, the selection would jump back to the start of the nested editor.
|
Reference in New Issue
Block a user