slate-react
0.117.4
Patch Changes
0.117.3
Patch Changes
0.117.2
Patch Changes
- #5908
06b21fdcThanks @nabbydude! - Fixed issue on android where deleting forward at the end of a block would delete the first character in the next block instead of the linebreak
0.117.1
Patch Changes
0.116.0
Minor Changes
- #5871
fb87646eThanks @12joan! - - Implement experimental chunking optimization (disabled by default, see https://docs.slatejs.org/walkthroughs/09-performance).- Add
useElementanduseElementIfhooks to get the current element. - BREAKING CHANGE: Decorations are no longer recomputed when a node's parent re-renders, only when the node itself re-renders or when the
decoratefunction is changed.- Ensure that
decorateis a pure function of the node passed into it. Depending on the node's parent may result in decorations not being recomputed when you expect them to be. - If this change impacts you, consider changing your
decoratefunction to work on the node's parent instead. - For example, if your
decoratefunction decorates acode-linebased on the parentcode-block's language, decorate thecode-blockinstead. - This is unlikely to result in any performance detriment, since in previous versions of
slate-react, the decorations of all siblings were recomputed when one sibling was modified.
- Ensure that
- BREAKING CHANGE: Elements no longer re-render due to selection changes.
- To re-render whenever an element becomes selected or deselected, subscribe to
useSelected. - To re-render whenever the selection changes anywhere in the editor, subscribe to
useSlateSelection. - To re-render whenever the intersection of the selection with an element changes (the previous behaviour), use
useSlateSelectorto compute this intersection usingRange.intersection. Ensure you provide a suitable equality function usingRange.equals.
- To re-render whenever an element becomes selected or deselected, subscribe to
- Increase minimum
slate-domversion to0.116.0. - Deprecate the
useSlateWithVhook - PERF: Use subscribable pattern for
useSlate,useSelectedand decorations to reduce re-renders.
- Add
0.115.0
Patch Changes
#5881
05263b54Thanks @12joan! - Fix IME issues in Firefox caused by placeholder#5877
747ebfdaThanks @12joan! - Fix a crash on iOS when composing text using an IME at the start of a block, at the cost of breaking capitalization on iOS in an empty editor.#5859
72532fd2Thanks @12joan! - OptimizeisElement,isText,isNodeListandisEditorby removing dependency onis-plain-objectand by performing shallow checks by default. To perform a full check, including all descendants, pass the{ deep: true }option toisElement,isNodeListorisEditor.
0.114.2
Patch Changes
0.114.1
Patch Changes
- #5853
9fe6184cThanks @12joan! - Increase minimumslateversion to 0.114.0 due to https://github.com/ianstormtaylor/slate/issues/5852
0.114.0
Minor Changes
#5850
22a3dda3Thanks @zbeyens! - - UpdateRenderLeafPropsinterface to addleafPositionproperty containingstart,end,isFirst, andisLastwhen a text node is split by decorations.- Add optional
renderTextprop to<Editable />component for customizing text node rendering.
- Add optional
#5848
2c62e017Thanks @dpolugic! - Use equalityFn in useSlateSelector during render as well
0.113.0
Patch Changes
- #5822
68915e8cThanks @RavenColEvol! - add context menu undo support
0.112.1
Patch Changes
- #5795
f456dfbfThanks @12joan! - Ignore selectionchange events originating from input and textarea elements (addresses Chrome bug https://issues.chromium.org/issues/389368412)
0.112.0
Patch Changes
#5763
644ebdc8Thanks @TyMick! - Use extendedEditortype inuseSlateWithVreturn type#5741
90fbcdefThanks @AdrienPoupa! - Fix ReactEditor.toDOMRange crash in setDomSelection
0.111.0
Minor Changes
0.110.3
Patch Changes
- #5746
e97a9f88Thanks @DustinMackintosh! - Invalidate node maps when nodes change until next react paint
0.110.2
Patch Changes
#5737
cd21bb1fThanks @WindRunnerMax! - fix: sync built-in state on undo when editor is unfocused#5727
335c5418Thanks @hernansartorio! - Call unref on pathRefs created for move_node to remove memory leak
0.110.1
Patch Changes
0.110.0
Minor Changes
0.109.0
Minor Changes
0.108.0
Minor Changes
0.107.1
Patch Changes
- #5677
a9a70405Thanks @WindrunnerMax! - fix unexpected event triggered when usingReactEditor.focus
0.107.0
Minor Changes
- #5676
ec9e5f0aThanks @ivan-sysoi! - Changed behaviour of ReactEditor.findDocumentOrShadowRoot. It returns shadow root or document without checking for the existence of the getSelection method.
0.106.0
Minor Changes
- #5659
e6254f70Thanks @MahmoudElsayad! - Enable Shadow DOM fix for all Safari versions.
Patch Changes
- #5664
0016f984Thanks @12joan! - Fix:state.isDraggingInternallyis stale if a drop handler outside the editor causes the dragged DOM element to unmount
0.105.0
Minor Changes
- #5654
2a8b4e95Thanks @alex-starostin! - Make capitalizing work for iOS
0.104.0
Minor Changes
- #5648
0bb7be54Thanks @MahmoudElsayad! - Fix Safari selection inside Shadow DOM.
0.102.0
Patch Changes
0.101.6
Patch Changes
- #5593
54594d0fThanks @12joan! - Fix: CallingReactEditor.focusdoesn't updateuseFocusedwhen running in @testing-library/react
0.101.5
Patch Changes
0.101.3
Patch Changes
0.101.2
Patch Changes
0.101.1
Patch Changes
0.101.0
Minor Changes
- #5527
fc081816Thanks @skogsmaskin! - Fixes a bug withReactEditor.focuswhere it would throw an error if the editor was in the middle of applying pending operations. With this change, setting focus will be retried until the editor no longer has any pending operations. CallingReactEditor.focuson a editor without a current selection, will now make a selection in the top of the document.
Patch Changes
#5549
f9cca97fThanks @12joan! - Firefox compat: Fix incorrect focus.offset when text node ends with \n
0.100.1
Patch Changes
- #5542
8688ed5cThanks @hellsan631! - Fix Memory Leak when switching between focused editables
0.100.0
Minor Changes
#5526
623f4452Thanks @jkcs! - AddonSelectionChangeandonValueChangein Slate React component#5528
c4c14882Thanks @dylans! - Update dependencies to React 18, Node 20, TS 5.2, etc.
0.99.0
Minor Changes
Patch Changes
- #5514
ff7db221Thanks @YaoKaiLun! - Fix move_node triggers nodes re-render
0.98.4
Patch Changes
- #5510
13c7d271Thanks @e1himself! - Remove an unused React ref
0.98.3
Patch Changes
- #5503
e308cd66Thanks @janpaepke! - bugfix: slate breaks on load on safari < 16.4
0.98.2
Patch Changes
- #5497
76ba3759Thanks @Dimitri-WEI-Lingfeng! - fix the bug that user cannot input chinese on mac wechat browser.
0.98.1
Patch Changes
- #5491
a5576e56Thanks @WcaleNieWolny! - Fix firefox table selection if table is contentedtiable
0.98.0
Minor Changes
- #5486
8b548fb5Thanks @WcaleNieWolny! - Fix invalid usage of the selection API in firefox
0.97.2
Patch Changes
- #5462
a6b606d8Thanks @Ben-Wormald! - Update hotkeys util to use isHotkey for better support for non-latin keyboards
- #5470
4bd15ed3Thanks @josephmr! - Fix Android caret placement regression when inputting into empty editor
0.97.1
Patch Changes
0.97.0
Minor Changes
Patch Changes
- #5453
cde0a155Thanks @Shiba-ligo! - fix regular expression for testing Webkit based browser.
0.96.0
Minor Changes
Patch Changes
0.95.0
Minor Changes
- #5422
0b179909Thanks @Chudesnov! - Prevents default focus styles from being removed in Editable
- #5421
91e388ecThanks @e1himself! - Rename<Slate>component prop fromvaluetoinitialValueto emphasize uncontrolled nature of it
0.94.2
Patch Changes
0.94.0
Patch Changes
0.93.0
Patch Changes
- #5383
3c3ea29aThanks @12joan! - Fix issue when tabbing into editor in Safari (https://github.com/udecode/plate/issues/2315)
0.92.0
Minor Changes
#5363
d42cd005Thanks @aciccarello! - update dependencies on react hooks to be more senstive to changesThe code should now meet eslint react hook standards
This could result in more renders
closes #3886
Patch Changes
- #5369
556a4565Thanks @alex-vladut! - Allow copying from editable void input
0.91.11
Patch Changes
- #5362
43999356Thanks @jason0x43! - Fix an issue where pastes in Safari wouldn't include application/x-slate-fragment data
- #5359
9825d29bThanks @jason0x43! - Fix an issue on Android where content containing a newline wouldn't be pasted properly
0.91.10
Patch Changes
- #5346
a5e833f6Thanks @edhager! - Fix a problem with Editable not calling the decorate function passed as a prop when it should.
- #5343
f7f02a8bThanks @12joan! - Fix error when triple-clicking a word preceding acontenteditable="false"DOM node in Chrome
0.91.9
Patch Changes
- #5339
62f8ddd9Thanks @12joan! - Fixes #5335. To prevent performance issues, make sure to wrap customrenderPlaceholdervalues inuseCallback.
0.91.8
Patch Changes
- #5325
af3f828bThanks @clauderic! - Fix edge-cases in the Android input manager when text leaf nodes are deleted, such as when deleting text leaf nodes adjacent to inline void nodes.
- #5327
4205e0f0Thanks @YasinChan! - Fix the issue of composition API and beforeinput event triggering between Chrome versions 60-75 on the Android platform.
0.91.7
Patch Changes
0.91.6
Patch Changes
- #5315
5784a38bThanks @clauderic! - TheRestoreDOMmanager that is used Android no longer restores the DOM to its previous state for text mutations. This allows the editor state to be reconciled during a composition without interrupting the composition, as programatically updating thetextContentof a text node ends the current composition.
- #5315
5784a38bThanks @clauderic! - Fixed consumer definedonInputevent handler not being invoked when passed to the<Editable>component.
0.91.5
Patch Changes
- #5306
213edbbfThanks @clauderic! - Use memoization to avoid unnecessarytextContentupdates in<TextString>component.
0.91.4
Patch Changes
- #5310
b94254d6Thanks @etrepum! - Fix to ensure that the latest versions of onChange and renderPlaceholder are used
0.91.3
Patch Changes
- #5305
11adbf96Thanks @alex-vladut! - Allow pasting plain text into editable voids
0.91.2
Patch Changes
- #5297
967d99ebThanks @edhager! - Fix memory leaks by adding clean-up code that looks for ref resets in Editable and Text.
0.91.1
Patch Changes
- #5251
6fa4b954Thanks @YaoKaiLun! - Fix the cursor jump to an unexpected position after deleting in android
0.91.0
Minor Changes
- #5271
9635b992Thanks @dsvgit! - If TextComponent decorations keep the same offsets and only paths are changed, prevent re-rendering because only decoration offsets matter when leaves are calculated.
0.90.0
Minor Changes
- #5278
9c4097a2Thanks @kylemclean! - Revert to using inline styles for default editor styles
0.89.0
Minor Changes
Patch Changes
- #5265
3cf51f4dThanks @kylemclean! - Improve compatibility for browsers that do not support ResizeObserver or :where selector
0.88.2
Patch Changes
- #5252
179d5c92Thanks @frellica! - remove qq browser frombeforeinputcompat list because it had updated its chromium core to version 94
0.88.0
Minor Changes
- #5226
0141f683Thanks @laufeyrut! - Check if getBoundingClientRect exist before trying to call bind on it. Makes unit testing experience agains Editable nicer
0.87.1
Patch Changes
- #5223
120437d6Thanks @alex-vladut! - Fix issue preventing editing and copy/paste into editable voids
0.87.0
Minor Changes
- #5206
96b7fcdbThanks @kylemclean! - Use stylesheet for default styles on Editable components
0.86.0
Minor Changes
- #5121
06942c6dThanks @laufeyrut! - Make it possible to copy/paste void elements
0.83.2
Patch Changes
- #5148
a2b6786dThanks @ksimons! - Ensure the min-height for placeholders is set on the correct editor - #5155
1b14de5Thanks @jameshfisher - Revert insertText breaking change that deletes fragment
0.83.1
Patch Changes
- #5143
347865caThanks @BitPhinix! - Fix scrollIntoView when selection is collapsed inside mark placeholder
0.83.0
Minor Changes
- #5123
0eb37e79Thanks @laufeyrut! - Make it possible to delete block elements with backspace in Chrome and Safari
Patch Changes
- #5127
341041f0Thanks @BitPhinix! - Cleanup and fix insertion placeholder mark compare
0.82.2
Patch Changes
- #5100
8eb1972bThanks @KittyGiraudel! - Addaria-multilineattribute to textbox editor
- #5105
55b95740Thanks @yume-chan! - ChangeElementcomponent to use callback-style ref to reliably track DOM node of rendered custom elements
0.82.1
Patch Changes
- #5084
50de780bThanks @BitPhinix! - Fix selection handling with slow flush in mark placeholders on android, fix auto-capitalize after placeholder
- #5091
e18879e7Thanks @e1himself! - FixwithReact()function type definition
0.82.0
Minor Changes
- #5041
9bc0b613Thanks @bryanph! - - Introduces auseSlateSelectionhook that triggers whenever the selection changes.- This also changes the implementation of SlateContext to use an incrementing value instead of an array replace to trigger updates
- Introduces a
useSlateWithVhook that includes the version counter which can be used to prevent re-renders
- #4988
fbab6331Thanks @BitPhinix! - Android input handling rewrite, replace composition insert prefixes with decoration based mark placeholders
0.81.3
Patch Changes
- #5054
1cc0797fThanks @BitPhinix! - Fix toSlatePoint in void nodes with nested editors if children are rendered as the last child
0.81.2
Patch Changes
- #5045
0b2e6c79Thanks @BitPhinix! - Don't native insert inside blocks with whitespace="pre" containing tab chars to work around https://bugs.chromium.org/p/chromium/issues/detail?id=1219139
- #5046
f96b6597Thanks @BitPhinix! - fix macos accent menu when using arrow keys
0.81.0
Minor Changes
- #4999
fe13a8f9Thanks @alexandercampbell! - Add new Slate.Scrubber interface to allow scrubbing end user data from exception text. The default behavior remains unchanged.
0.80.0
Patch Changes
- #5007
92c5730aThanks @jasonphillips! - Revert #4876 & #4910 to restore original decorations behavior
0.79.0
Minor Changes
- #4981
cb8a5515Thanks @BitPhinix! - AddReactEditor.isComposing(editor)to get the currentisComposingstate
0.78.1
Patch Changes
- #4979
6afa9f6aThanks @BitPhinix! - Unset isComposing on keydown with isCompsing false
0.77.4
Patch Changes
- #4965
a4536e2aThanks @BitPhinix! - Fix triple click handling in nested blocks
0.77.3
Patch Changes
- #4957
c1e3fbaaThanks @BitPhinix! - Don't treat events with non-selection target range as native
0.77.2
Patch Changes
- #4951
5b51e87dThanks @BitPhinix! - Fix double insert in anchor element decorations
0.77.1
Patch Changes
- #4948
9957c214Thanks @BitPhinix! - Prevent native insert at the end of anchor elements
0.77.0
Minor Changes
- #4926
076ab9a6Thanks @Auralytical! - Fix firefox three digit version check
Patch Changes
- #4944
486c385bThanks @BitPhinix! - Fix crash when tripple clicking editor root
0.76.1
Patch Changes
- #4923
08d5a12cThanks @BitPhinix! - Call keyDown handler while composing
- #4920
f6b7ca1fThanks @adri1wald! - fix useFocused hook in react >= 17
- #4919
7de7cdcfThanks @BitPhinix! - Restore user selection after applying beforeinput with target range
- #4922
9892cf0fThanks @BitPhinix! - Make Slate component onChange optional
0.76.0
Minor Changes
#4873
20acca4bThanks @bryanph! - A different behavior for inserting a soft break with shift+enter is quite common in rich text editors. Right now you have to do this in onKeyDown which is not so nice. This adds a separate insertSoftBreak method on the editor instance that gets called when a soft break is inserted. This maintains the current default behavior for backwards compatibility (it just splits the block). But at least you can easily overwrite it now.If you rely on overwriting editor.insertBreak for extra behavior for soft breaks this might be a breaking change for you and you should overwrite editor.insertSoftBreak instead.
Patch Changes
#4885
07669dcaThanks @ryanmitts! - toSlatePoint should not consider a selection within a void node if the void node isn't in the editor itself.Prior to this fix, a nested Slate editor inside a void node in a parent editor would not allow you to start typing text in a blank editor state correctly. After the first character insertion, the selection would jump back to the start of the nested editor.
- #4910
2a8d86f1Thanks @jasonphillips! - Fix decorations applied across nested elements
0.75.0
Minor Changes
- #4883
3b3b0e32Thanks @always-maap! - Fix chrome and edge three digit version check
0.74.2
Patch Changes
- #4876
1b205c08Thanks @nemanja-tosic! - Fix decorations not getting applied for children unless parent changes - #4874
4d28948Thanks @bryanph! - Revert #4755
0.74.1
Patch Changes
- #4868
7499d4b4Thanks @sennpang! - fixed cursor when triple clicking on text and type over it, fixes #4862
0.74.0
Minor Changes
- #4841
47f2403eThanks @Fibs7000! - Added redux-style useSlateSelector to improve and prevent unneccessary rerendering with the useSlate hook
0.73.0
Patch Changes
- #4840
100448d5Thanks @BitPhinix! - Render void spacer in readonly mode
0.72.9
Patch Changes
- #4828
d5ac8237Thanks @BitPhinix! - Reset isDraggingInternally onDragEnd and onDrop even if the event is handled by the editable handler
- #4819
80661509Thanks @ugaya40! - Fix a possible update of react state after Slate component is unmounted
0.72.8
Patch Changes
0.72.7
Patch Changes
- #4813
a5fd62ddThanks @BitPhinix! - Don't throw in toSlatePoint while using supressThrow if leaf has no text node
- #4809
e9987529Thanks @BitPhinix! - Flush onDOMSelectionChange on onDOMBeforeInput
0.72.6
Patch Changes
0.72.5
Patch Changes
- #4749
a3dfb151Thanks @Jabher! - Fix "cannot resolve DOM point" error when switching between multiple errors
0.72.4
Patch Changes
- #4753
e9a46ad2Thanks @alessiogaldy! - Fix "editor.insertText never gets called inside plugins on android"
#4779
345b8fc9Thanks @alessiogaldy! - Android editable updates- Remove logic to delay handling of text insertion
- Call Transforms.setSelection before Editor.insertText to adjust position
- #4786
67aa1f10Thanks @alessiogaldy! - - Restore logic to delay text insertion on android- Always call Trasform.setSelection before calling Editor.insertText
- #4788
a8c08a4eThanks @YasinChan! - Android mergeEditor.insertTextlogic.
0.72.2
Patch Changes
- #4734
3c07a870Thanks @YasinChan! - [AndroidEditor] Solve input association problems and add click events. - #4733
ccafb69Thanks @Schipy! - Optimize TextString rendering to support browser/OS text features, e.g. fix native spellcheck.
0.72.1
Patch Changes
- #4720
1217021aThanks @bryanph! - Add origin event type to setFragmentData to be able to distinguish copy, cut and drag
- #4727
0334851cThanks @ahoisl! - Fix "Cannot resolve from DOM point" error on onDomSelectionChange for readonly void elements
0.72.0
Minor Changes
Patch Changes
- #4706
6d194077Thanks @BitPhinix! - Update android restoreDOM to use partial dom restoring
0.71.0
Minor Changes
- #4682
e5380655Thanks @matthewkeil! - Support SSR for autoCorrect, spellCheck and autoCapitalize. Fixes prop mismatch between server and client. Removes the need to add
0.70.2
Patch Changes
- #4669
807716d7Thanks @BitPhinix! - Flush scheduleOnDOMSelectionChange on beforeinput
0.70.1
Patch Changes
- #4652
95389ed7Thanks @karthikcodes6! - Disabled the auto scroll behaviour when the editor has any active selection
- #4650
b6643132Thanks @e1himself! - Do not disable Grammarly extension in Slate editors
0.70.0
Patch Changes
0.69.0
Minor Changes
- #4625
e54f2a0eThanks @echarles! - insertTextData and insertFragmentData return a boolean (true if some content has been effectively inserted)
0.68.1
Patch Changes
- #4627
ec01e75fThanks @jameshfisher! - Fixed issues where cursor jumps to wrong location
0.68.0
Minor Changes
- #4620
0b59ad54Thanks @NicklasAndersson! - Support selection in readOnly=true editors.
0.67.1
Patch Changes
- #4616
77d9f60aThanks @jameshfisher! - Fixed crash on self-deleting void node
0.67.0
Minor Changes
- #4540
11ef83b4Thanks @bryanph! - The Slate Provider's "value" prop is now only used as initial state for editor.children as was intended before. If your code relies on replacing editor.children you should do so by replacing it directly instead of relying on the "value" prop to do this for you.
Patch Changes
- #4577
4b2e4000Thanks @jameshfisher! - Fixed a bug that removed the selection when hovering over a non-selectable DOM element
- #4584
f40e515dThanks @jameshfisher! - Fixed bug: setting selection fromcontentEditable:falseelement causes crash
0.66.7
Patch Changes
0.66.6
Patch Changes
0.66.4
Patch Changes
- #4304
7ba486aaThanks @davidruisinger! - Fixed a bug where text was typed backwards within nested editor
0.66.3
Patch Changes
- #4547
677da0caThanks @clauderic! - Fixed a bug that caused the editor to be unable to resolve a Slate point from a DOM point when selecting an entire document that ended in a new line in Firefox.
- #4526
bc85497dThanks @VictorBaron! - Fix - delete selected inline void in chrome
- #4549
f9c41a56Thanks @nemanja-tosic! - Fix deletion of expanded range (#4546)
0.66.2
Patch Changes
- #4529
bd80a0b8Thanks @nemanja-tosic! - Fix erroneous text after native insert
0.66.1
Patch Changes
0.66.0
Minor Changes
Patch Changes
- #4475
c1433f56Thanks @skogsmaskin! - [slate-react]: fix selection bugs when multiple editors share value
- #4450
220f2d2cThanks @neko-neko! - Changed so that the onKeyDown event do not fired while IME converting.
- #4454
d06706c9Thanks @imdbsd! - Fix to read fragment from data-slate-fragment when application/x-slate-fragment is missing
- #4451
8e4120aeThanks @githoniel! - fix IME double input with editor mark
- #4503
2065c5bdThanks @bytrangle! - Fix incorrect selection when triple clicking blocks in Editable component
- #4365
906e5af1Thanks @samarsault! - fix a bug where element selections were not captured by useSelected
0.65.3
Patch Changes
- #4175
bde6e804Thanks @gyh9457! - Fixed a bug in the memoization logic for the leaves of text nodes.
- #4394
01889807Thanks @jaked! - fix bug where decorate is not called on immediate children of editor
- #4427
3f69a9f3Thanks @ben10code! - Fix crash when unmounting an editor rendered within a React portal. The issue was arising at unmount time, becausegetRootNodereturned the dettached portal node and it is not an instance ofDocumentorShadowRoot. As a fix,getDocumentOrShadowRoothas been refactored to return a root node instead of throwing. In sum, this patch fixes a regression bug introduced by https://github.com/ianstormtaylor/slate/pull/3749/
- #4369
c217dbb5Thanks @thesunny! - Scroll when inserting new text will now scroll parent scrollables
- #4333
e0776c5cThanks @dylans! - Allow setFragmentData to work without copy/paste or DnD data structure
0.65.2
Patch Changes
- #4331
a3bc97afThanks @golota60! - Fix deletion of selected inline void nodes in Safari when presssingbackspaceordelete. This is a bug that was originally fixed only for Google Chrome, but the fix also needs to be applied in Safari.
0.65.1
Patch Changes
- #4324
61171a23Thanks @clauderic! - Fix backward typing bug in Safari by ensuring the selection is always removed on blur. Safari doesn't always remove the selection, even if the contenteditable element no longer has focus. In this scenario, we need to forcefully remove the selection on blur. Refer to https://stackoverflow.com/questions/12353247/force-contenteditable-div-to-stop-accepting-input-after-it-loses-focus-under-web
0.65.0
Minor Changes
#4299
2c17e2b7Thanks @georgberecz! - Allow custom event handlers on Editable component to return boolean flag to specify whether the event can be treated as being handled.By default, the
Editablecomponent comes with a set of event handlers that handle typical rich-text editing behaviors (for example, it implements its ownonCopy,onPaste,onDrop, andonKeyDownhandlers).In some cases you may want to extend or override Slate's default behavior, which can be done by passing your own event handler(s) to the
Editablecomponent.Your custom event handler can control whether or not Slate should execute its own event handling for a given event after your handler runs depending on the return value of your event handler as described below.
import {Editable} from 'slate-react'; function MyEditor() { const onClick = event => { // Implement custom event logic... // When no value is returned, Slate will execute its own event handler when // neither isDefaultPrevented nor isPropagationStopped was set on the event }; const onDrop = event => { // Implement custom event logic... // No matter the state of the event, treat it as being handled by returning // true here, Slate will skip its own event handler return true; }; const onDragStart = event => { // Implement custom event logic... // No matter the status of the event, treat event as *not* being handled by // returning false, Slate will exectue its own event handler afterward return false; }; return ( <Editable onClick={onClick} onDrop={onDrop} onDragStart={onDragStart} {/*...*/} /> ) }
Patch Changes
- #4266
411e5a19Thanks @TheSpyder! - Removed accidental bundling ofslate-historyinsideslate-react
- #4307
a7e3a181Thanks @clauderic! - Fix deletion of selected inline void nodes in Chrome. Chrome does not fire abeforeinputevent when deleting backwards within an inline void node, so we need to add special logic to handle this edge-case for Chrome only.
- #4272
294d5120Thanks @clauderic! - Fix errors accessingglobalThisin browsers that do not implement it
- #4295
dfc03960Thanks @dubzzz! - Fix React warnings related toautoCorrectandautoCapitalizeattributes being passed as a boolean instead of a string.
- #4271
ff267767Thanks @omerg! - Fixed typo: RenamedtoSlatePointargumentextractMatchtoexactMatch
0.64.0
Minor Changes
#4257
4f0d1120Thanks @clauderic! - Added support for Android devices using aMutationObserverbased reconciliation layer.Bugs should be expected; translating mutations into a set of operations that need to be reconciled onto the Slate model is not an absolute science, and requires a lot of guesswork and handling of edge cases. There are still edge cases that aren't being handled.
This reconciliation layer aims to support Android 10 and 11. Earlier versions of Android work to a certain extent, but have more bugs and edge cases that currently aren't well supported.
0.63.0
Patch Changes
- #4238
c14e1fbcThanks @clauderic! - Fix duplicated content and other bugs related to drag and drop handling
- #4237
623960a7Thanks @dylans! - Fixed text insertion logic to prevent crashing in newer Firefox versions.
0.62.1
Patch Changes
- #4118
6a137633Thanks @kamilkazmierczak! - Improved detection of legacy browsers that don't have properbeforeinputsupport.
- #4190
ea2eefefThanks @juliankrispel! - Added arenderPlaceholderprop to the<Editable>component for customizing how placeholders are rendered.
- #4157
de5cc7e5Thanks @githoniel! - Fixed a bug when syncing the selection for IME-based editing.
- #4158
ea6dc089Thanks @githoniel! - Fixed a bug that resulted in doubly-input characters when using an IME.
- #4211
1c32b97dThanks @clauderic! - Collapse expanded selection before handlingmoveWordBackward(alt + left) andmoveWordForward(alt + right) hotkeys.
- #4219
737aaa9cThanks @juliankrispel! - Fixes error that occurs when Editor is rendered inside iframe
0.62.0
Minor Changes
c6002024- Add directional awareness toEditor.deleteFragment. This is an obscure change, but is a required distinction when implementing features that need to "fake delete" content (like Google Docs's suggestions). Previously deleting always collapsed to the end of a range, but now it can collapse forwards as well.
- #4154
7283c51fThanks @ianstormtaylor! - Start using 🦋 Changesets to manage releases. Going forward, whenever a pull request is made that fixes or adds functionality to Slate, it will need to be accompanied by a changset Markdown file describing the change. These files will be automatically used in the release process when bump the versions of Slate and compiling the changelog.
Patch Changes
- #4150
bbd7d9c3Thanks @nivekithan! - Added support for using the newbeforeInputevents in the latest Firefox.
c6002024- Fixed spellcheck disabling logic to always work in older versions of Firefox.
c6002024- Fixed browser-detection behavior to work with Deno.
d5589279- Updated placeholder styles to allow for wrapping long placeholder text.
- #3698
bf83f333Thanks @pubuzhixing8! - Fixed selection updating with IME inputs in browsers that supportbeforeinput.
- #3652
f3fb40ccThanks @Andarist! - Fixed selection logic when a controlled editor's nodes change out from under it.
c6002024- Fixed a bug where memoization logic would prevent placeholders from re-rendering properly.
- #3326
d5b2d7f5Thanks @rockettomatooo! - Added invariants when passing invaludvalueoreditorprops to<Editable>.
c6002024- Fixed cursor movement in RTL text.
c6002024- Fixed a bug in the conversion of DOM points to Slate points.
- #3746
f8be509eThanks @gztomas! - Fixed auto-scrolling behavior when a block is bigger than the viewport.
c6002024- Fixed a bug that occurred when using Babel'sloosemode.
c6002024- Fixed deleting void elements when using cut-and-paste.
c6002024- Fixed a bug that crashed the editor when using IME input.
- #3396
469e6b26Thanks @cvlmtg! - Fixed allowing theonPastehandler to be overridden in all browsers.
c6002024- Fixed internal decoration logic to be faster and require fewer re-renders.
- #3894
7fe41f15Thanks @msc117! - Fixed an error that happened when selecting void nodes in a read-only editor.
c6002024- Fixedmove_nodeoperations to not always require a full re-render.
d5589279- Fixed normalization of DOM points to be more accurate when triple-clicking.
d5589279- Fixed a bug that preventedisFocusedfrom updating on certain focus changes.
c6002024- Fixed IME input to not insert repeated characters.
- #3749
0473d0bfThanks @davidruisinger! - Fixes Slate to work with the Shadow DOM.
c6002024- Fixed deleting by line to account for the line breaks in the browser.