Minor Changes
- #6183
35830d7Thanks @dylans! -initialValueon<Slate>is now optional. When it's left out, the editor's existingeditor.childrenare used, for editors created and filled ahead of rendering. Leaving it out whileeditor.childrenis empty throws with a hint to passinitialValue={[]}if an empty editor is intended.
Patch Changes
-
#6174
ae5dc30Thanks @dylans! -autoFocusnow focuses throughReactEditor.focus, which selects the start of the document when there's no selection, so you can type right away. Before, Firefox and Safari could end up focused with no selection, especially under React strict mode. -
#6182
835e185Thanks @dylans! - Ignore DOM selection changes while focus is outside the editor (unless it's read-only). Firefox moves the DOM selection of a blurred editor when its content changes, so inserting text from outside the editor, such as from a toolbar button, used to jump the selection to the start. -
#6184
7a4e15cThanks @dylans! - Keep the caret in the editor's text when the browser moves it to a spot Slate can't represent, such as below a table that ends the document after pressing ArrowDown. Typing there used to insert the character twice: once in the last cell and once as stray text outside the table. -
#6175
46cd8f9Thanks @dylans! - An emptyinitialValueis now loaded as one empty block, so the editor has somewhere to put the cursor instead of breaking. -
#6179
25f6353Thanks @dylans! - Fix clicks occasionally being undone when the editor re-renders right after them. A render inside the 100 ms selection-change throttle used to write the previous selection back to the DOM; it now applies the clicked selection instead. -
#6180
13d7c12Thanks @dylans! - Make the void spacer unselectable (user-select: none), so a selection that includes a void element no longer shows a darker band at its edge in Chromium.