Minor Changes
-
#6266
bc91dcaThanks @dylans! - Addeditor.onDOMErrorand the lookupsDOMEditor.resolveDOMPoint,DOMEditor.resolveDOMRangeandDOMEditor.resolveEventRange.The resolve lookups return
nullinstead of throwing. While the DOM is still catching up with the model (the editor isn't mounted, a render is pending, or Android input hasn't been applied yet), a missing point is ordinary and isn't reported. Once the DOM has settled, a point that still can't be found means a broken rendering contract, such as an element that doesn't render itschildren, and is reported througheditor.onDOMError, which passes it to the browser'sreportErrorby default.Slate's own handlers now use these lookups with no try/catch. ArrowUp near a trailing newline, the
beforeinputlink-end check, shift-clicking past a selected void and restoring the DOM selection no longer throw out of their handlers. Selection syncing, which used to swallow every failure, now reports only the broken-contract case.slate-react now requires slate-dom 0.141.0 or later.