-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Description
Do you want to request a feature or report a bug?
Bug
What's the current behavior?
Current behavior is that when you click into the toolbar or out of the document the editor's selection becomes null.
https://codesandbox.io/s/fervent-bouman-ju71u?fontsize=14&hidenavigation=1&theme=dark
Tested on Firefox, Safari and Chrome although Firefox has different behavior. Firefox sometimes sets the cursor position to the end of the text in the editor depending on how you focus out of the editor.
Slate: 0.57.1
Browser: Chrome / Safari / Firefox
OS: Mac
What's the expected behavior?
Focus out shouldn't erase editor selection.
Changes to Example Site To Produce Behavior
In order to test this we forked the rich text example and made sure the toolbar style buttons did not disable on focus out. Then we used the ReactEditor.focus
method in the MarkdownButton
component's onMouseDown
handler in the richtext.js
file.