I created a slatejs rich text editor with voids, but I have a problem which is I can't get the current selection while I am doing actions inside the popover. However, I recreated the problem here on sandbox.
- additional info
- if you need to know why I want to get the
editor.selection
inside a popover? I need that because sometimes I do actions inside the popover and I need to update the document manula usingTrsnform.setNodes(editor,newData,at:{editor.selection.path})
- if you need to know why I want to get the
- my goal is to get
editor.selection
inSimplePopover.tsx:64
in my sandbox.
I see an error on the sandbox, but have suggestion for you, if I have understood your question correctly, the component invoking SimplePopover might be getting re-rendered, resulting in selection being lost. You can maintain that, invoke popover with it, have
editor.selection = props.selection
and clear selection on closing the popover.