slate-react@0.147.6
- #6364
6f00413Thanks @dannelundqvist! - Copy and cut now use the selection the user just made. Selection changes reacheditor.selectiona little later than they happen, and copy and cut wrote the clipboard fromeditor.selection, so a copy straight after selecting, such as Ctrl+A followed at once by Ctrl+C, could copy the previous selection or nothing at all. Copy and cut now process any pending selection change first, before anonCopyoronCuthandler runs.
slate@0.147.4
-
#6351
18de0a4Thanks @dylans! -editor.insertTextwith an explicitatnow inserts there when the editor has no selection, and no longer applies or clears pendingeditor.marks, which belong to the selection. -
#6349
5939eb4Thanks @Marve10s! - Forward options fromEditor.insertTextandEditor.insertNodeto the corresponding editor methods. Explicit insertion locations and other supported options now take effect instead of being silently ignored.
slate-dom@0.147.3
- #6346
b34e312Thanks @dylans! - On Android,toSlatePointno longer throwsTypeErrorreadinghasAttributeof null when the DOM point is in a text node the keyboard has detached. It returns null withsuppressThrow, and otherwise throws the usual "Cannot resolve a Slate point" error. Seen with Firefox for Android while accepting a keyboard suggestion in a new paragraph (#6343).
slate-react@0.147.3
- #6346
b34e312Thanks @dylans! - Firefox for Android no longer splits a word across blocks when a keyboard suggestion is accepted in an empty paragraph. Firefox commits the word as oneinsertTextper character at offsets it computed first; once the first character re-rendered the empty leaf, the rest of the word went into the next block. A character that arrives within 25 ms of the previous one and targets somewhere other than the editor's selection is now inserted at the selection instead (#6343).
slate-react@0.147.2
- #6344
18f1927Thanks @dylans! - Chrome's Writing Direction menu command no longer breaks the editor. The command changes the DOM without abeforeinputevent, wrapping text in adirectionspan, so React later threwNotFoundErroronremoveChildand the editor unmounted. Slate now undoes the DOM changes of anyformat*input it was not asked to handle first and keeps the selection.
slate-react@0.147.0
- #6338
6c4cab5Thanks @dylans! - AddresolveDOMNode,resolveSlateNode,resolveSlatePointandresolveSlateRange, which returnnullinstead of throwing, likeresolveDOMPointandresolveDOMRange. UnlikesuppressThrow: true,resolveSlatePointandresolveSlateRangealso returnnullbeforeEditablemounts and for a selection with no range. Thetolookups andsuppressThroware unchanged.
slate-dom@0.147.0
- #6338
6c4cab5Thanks @dylans! - AddresolveDOMNode,resolveSlateNode,resolveSlatePointandresolveSlateRange, which returnnullinstead of throwing, likeresolveDOMPointandresolveDOMRange. UnlikesuppressThrow: true,resolveSlatePointandresolveSlateRangealso returnnullbeforeEditablemounts and for a selection with no range. Thetolookups andsuppressThroware unchanged.
slate-dom@0.146.1
-
#6334
0f99057Thanks @dylans! -resolveDOMPointandresolveDOMRangeno longer report a miss througheditor.onDOMError. A miss is often ordinary: a layout effect that measures the selection runs before the edited text's DOM is attached, and replacingeditor.childrencan leave the selection past the end of the new text, so these were reported as broken rendering when nothing was wrong. Slate no longer callseditor.onDOMErroritself; the hook stays for apps and plugins.resolveDOMRangealso returnsnullinstead of throwing when the editor's window isn't registered yet, for example from a layout effect inside the first render, and checks the focus only when the anchor resolves. Scrolling the selection into view no longer throws when the unhung range ends in an element that doesn't render its children.