-
#5763
644ebdc8
Thanks @TyMick! - Use extendedEditor
type inuseSlateWithV
return type -
#5741
90fbcdef
Thanks @AdrienPoupa! - Fix ReactEditor.toDOMRange crash in setDomSelection
- #5746
e97a9f88
Thanks @DustinMackintosh! - Invalidate node maps when nodes change until next react paint
-
#5737
cd21bb1f
Thanks @WindRunnerMax! - fix: sync built-in state on undo when editor is unfocused -
#5727
335c5418
Thanks @hernansartorio! - Call unref on pathRefs created for move_node to remove memory leak
- #5677
a9a70405
Thanks @WindrunnerMax! - fix unexpected event triggered when usingReactEditor.focus
- #5676
ec9e5f0a
Thanks @ivan-sysoi! - Changed behaviour of ReactEditor.findDocumentOrShadowRoot. It returns shadow root or document without checking for the existence of the getSelection method.
- #5659
e6254f70
Thanks @MahmoudElsayad! - Enable Shadow DOM fix for all Safari versions.
- #5664
0016f984
Thanks @12joan! - Fix:state.isDraggingInternally
is stale if a drop handler outside the editor causes the dragged DOM element to unmount
- #5654
2a8b4e95
Thanks @alex-starostin! - Make capitalizing work for iOS
- #5648
0bb7be54
Thanks @MahmoudElsayad! - Fix Safari selection inside Shadow DOM.
- #5593
54594d0f
Thanks @12joan! - Fix: CallingReactEditor.focus
doesn't updateuseFocused
when running in @testing-library/react
- #5527
fc081816
Thanks @skogsmaskin! - Fixes a bug withReactEditor.focus
where 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.focus
on a editor without a current selection, will now make a selection in the top of the document.
-
#5549
f9cca97f
Thanks @12joan! - Firefox compat: Fix incorrect focus.offset when text node ends with \n
- #5542
8688ed5c
Thanks @hellsan631! - Fix Memory Leak when switching between focused editables
-
#5526
623f4452
Thanks @jkcs! - AddonSelectionChange
andonValueChange
in Slate React component -
#5528
c4c14882
Thanks @dylans! - Update dependencies to React 18, Node 20, TS 5.2, etc.
- #5514
ff7db221
Thanks @YaoKaiLun! - Fix move_node triggers nodes re-render
- #5510
13c7d271
Thanks @e1himself! - Remove an unused React ref
- #5503
e308cd66
Thanks @janpaepke! - bugfix: slate breaks on load on safari < 16.4
- #5497
76ba3759
Thanks @Dimitri-WEI-Lingfeng! - fix the bug that user cannot input chinese on mac wechat browser.
- #5491
a5576e56
Thanks @WcaleNieWolny! - Fix firefox table selection if table is contentedtiable
- #5486
8b548fb5
Thanks @WcaleNieWolny! - Fix invalid usage of the selection API in firefox
- #5462
a6b606d8
Thanks @Ben-Wormald! - Update hotkeys util to use isHotkey for better support for non-latin keyboards
- #5470
4bd15ed3
Thanks @josephmr! - Fix Android caret placement regression when inputting into empty editor
- #5453
cde0a155
Thanks @Shiba-ligo! - fix regular expression for testing Webkit based browser.
- #5422
0b179909
Thanks @Chudesnov! - Prevents default focus styles from being removed in Editable
- #5421
91e388ec
Thanks @e1himself! - Rename<Slate>
component prop fromvalue
toinitialValue
to emphasize uncontrolled nature of it
- #5383
3c3ea29a
Thanks @12joan! - Fix issue when tabbing into editor in Safari (udecode/plate#2315)
-
#5363
d42cd005
Thanks @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
- #5369
556a4565
Thanks @alex-vladut! - Allow copying from editable void input
- #5362
43999356
Thanks @jason0x43! - Fix an issue where pastes in Safari wouldn't include application/x-slate-fragment data
- #5359
9825d29b
Thanks @jason0x43! - Fix an issue on Android where content containing a newline wouldn't be pasted properly
- #5346
a5e833f6
Thanks @edhager! - Fix a problem with Editable not calling the decorate function passed as a prop when it should.
- #5343
f7f02a8b
Thanks @12joan! - Fix error when triple-clicking a word preceding acontenteditable="false"
DOM node in Chrome
- #5339
62f8ddd9
Thanks @12joan! - Fixes #5335. To prevent performance issues, make sure to wrap customrenderPlaceholder
values inuseCallback
.
- #5325
af3f828b
Thanks @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
4205e0f0
Thanks @YasinChan! - Fix the issue of composition API and beforeinput event triggering between Chrome versions 60-75 on the Android platform.
- #5315
5784a38b
Thanks @clauderic! - TheRestoreDOM
manager 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 thetextContent
of a text node ends the current composition.
- #5315
5784a38b
Thanks @clauderic! - Fixed consumer definedonInput
event handler not being invoked when passed to the<Editable>
component.
- #5306
213edbbf
Thanks @clauderic! - Use memoization to avoid unnecessarytextContent
updates in<TextString>
component.
- #5310
b94254d6
Thanks @etrepum! - Fix to ensure that the latest versions of onChange and renderPlaceholder are used
- #5305
11adbf96
Thanks @alex-vladut! - Allow pasting plain text into editable voids
- #5297
967d99eb
Thanks @edhager! - Fix memory leaks by adding clean-up code that looks for ref resets in Editable and Text.
- #5251
6fa4b954
Thanks @YaoKaiLun! - Fix the cursor jump to an unexpected position after deleting in android
- #5271
9635b992
Thanks @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.
- #5278
9c4097a2
Thanks @kylemclean! - Revert to using inline styles for default editor styles
- #5265
3cf51f4d
Thanks @kylemclean! - Improve compatibility for browsers that do not support ResizeObserver or :where selector
- #5252
179d5c92
Thanks @frellica! - remove qq browser frombeforeinput
compat list because it had updated its chromium core to version 94
- #5226
0141f683
Thanks @laufeyrut! - Check if getBoundingClientRect exist before trying to call bind on it. Makes unit testing experience agains Editable nicer
- #5223
120437d6
Thanks @alex-vladut! - Fix issue preventing editing and copy/paste into editable voids
- #5206
96b7fcdb
Thanks @kylemclean! - Use stylesheet for default styles on Editable components
- #5121
06942c6d
Thanks @laufeyrut! - Make it possible to copy/paste void elements
- #5148
a2b6786d
Thanks @ksimons! - Ensure the min-height for placeholders is set on the correct editor - #5155
1b14de5
Thanks @jameshfisher - Revert insertText breaking change that deletes fragment
- #5143
347865ca
Thanks @BitPhinix! - Fix scrollIntoView when selection is collapsed inside mark placeholder
- #5123
0eb37e79
Thanks @laufeyrut! - Make it possible to delete block elements with backspace in Chrome and Safari
- #5127
341041f0
Thanks @BitPhinix! - Cleanup and fix insertion placeholder mark compare
- #5100
8eb1972b
Thanks @KittyGiraudel! - Addaria-multiline
attribute to textbox editor
- #5105
55b95740
Thanks @yume-chan! - ChangeElement
component to use callback-style ref to reliably track DOM node of rendered custom elements
- #5084
50de780b
Thanks @BitPhinix! - Fix selection handling with slow flush in mark placeholders on android, fix auto-capitalize after placeholder
- #5091
e18879e7
Thanks @e1himself! - FixwithReact()
function type definition
- #5041
9bc0b613
Thanks @bryanph! - - Introduces auseSlateSelection
hook 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
useSlateWithV
hook that includes the version counter which can be used to prevent re-renders
- #4988
fbab6331
Thanks @BitPhinix! - Android input handling rewrite, replace composition insert prefixes with decoration based mark placeholders
- #5054
1cc0797f
Thanks @BitPhinix! - Fix toSlatePoint in void nodes with nested editors if children are rendered as the last child
- #5045
0b2e6c79
Thanks @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
f96b6597
Thanks @BitPhinix! - fix macos accent menu when using arrow keys
- #4999
fe13a8f9
Thanks @alexandercampbell! - Add new Slate.Scrubber interface to allow scrubbing end user data from exception text. The default behavior remains unchanged.
- #5007
92c5730a
Thanks @jasonphillips! - Revert #4876 & #4910 to restore original decorations behavior
- #4981
cb8a5515
Thanks @BitPhinix! - AddReactEditor.isComposing(editor)
to get the currentisComposing
state
- #4979
6afa9f6a
Thanks @BitPhinix! - Unset isComposing on keydown with isCompsing false
- #4965
a4536e2a
Thanks @BitPhinix! - Fix triple click handling in nested blocks
- #4957
c1e3fbaa
Thanks @BitPhinix! - Don't treat events with non-selection target range as native
- #4951
5b51e87d
Thanks @BitPhinix! - Fix double insert in anchor element decorations
- #4948
9957c214
Thanks @BitPhinix! - Prevent native insert at the end of anchor elements
- #4926
076ab9a6
Thanks @Auralytical! - Fix firefox three digit version check
- #4944
486c385b
Thanks @BitPhinix! - Fix crash when tripple clicking editor root
- #4923
08d5a12c
Thanks @BitPhinix! - Call keyDown handler while composing
- #4920
f6b7ca1f
Thanks @adri1wald! - fix useFocused hook in react >= 17
- #4919
7de7cdcf
Thanks @BitPhinix! - Restore user selection after applying beforeinput with target range
- #4922
9892cf0f
Thanks @BitPhinix! - Make Slate component onChange optional
-
#4873
20acca4b
Thanks @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.
-
#4885
07669dca
Thanks @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
2a8d86f1
Thanks @jasonphillips! - Fix decorations applied across nested elements
- #4883
3b3b0e32
Thanks @always-maap! - Fix chrome and edge three digit version check
- #4876
1b205c08
Thanks @nemanja-tosic! - Fix decorations not getting applied for children unless parent changes - #4874
4d28948
Thanks @bryanph! - Revert #4755
- #4868
7499d4b4
Thanks @sennpang! - fixed cursor when triple clicking on text and type over it, fixes #4862
- #4841
47f2403e
Thanks @Fibs7000! - Added redux-style useSlateSelector to improve and prevent unneccessary rerendering with the useSlate hook
- #4840
100448d5
Thanks @BitPhinix! - Render void spacer in readonly mode
- #4828
d5ac8237
Thanks @BitPhinix! - Reset isDraggingInternally onDragEnd and onDrop even if the event is handled by the editable handler
- #4819
80661509
Thanks @ugaya40! - Fix a possible update of react state after Slate component is unmounted
- #4813
a5fd62dd
Thanks @BitPhinix! - Don't throw in toSlatePoint while using supressThrow if leaf has no text node
- #4809
e9987529
Thanks @BitPhinix! - Flush onDOMSelectionChange on onDOMBeforeInput
- #4749
a3dfb151
Thanks @Jabher! - Fix "cannot resolve DOM point" error when switching between multiple errors
- #4753
e9a46ad2
Thanks @alessiogaldy! - Fix "editor.insertText never gets called inside plugins on android"
-
#4779
345b8fc9
Thanks @alessiogaldy! - Android editable updates- Remove logic to delay handling of text insertion
- Call Transforms.setSelection before Editor.insertText to adjust position
- #4786
67aa1f10
Thanks @alessiogaldy! - - Restore logic to delay text insertion on android- Always call Trasform.setSelection before calling Editor.insertText
- #4788
a8c08a4e
Thanks @YasinChan! - Android mergeEditor.insertText
logic.
- #4734
3c07a870
Thanks @YasinChan! - [AndroidEditor] Solve input association problems and add click events. - #4733
ccafb69
Thanks @Schipy! - Optimize TextString rendering to support browser/OS text features, e.g. fix native spellcheck.
- #4720
1217021a
Thanks @bryanph! - Add origin event type to setFragmentData to be able to distinguish copy, cut and drag
- #4727
0334851c
Thanks @ahoisl! - Fix "Cannot resolve from DOM point" error on onDomSelectionChange for readonly void elements
- #4706
6d194077
Thanks @BitPhinix! - Update android restoreDOM to use partial dom restoring
- #4682
e5380655
Thanks @matthewkeil! - Support SSR for autoCorrect, spellCheck and autoCapitalize. Fixes prop mismatch between server and client. Removes the need to add
- #4669
807716d7
Thanks @BitPhinix! - Flush scheduleOnDOMSelectionChange on beforeinput
- #4652
95389ed7
Thanks @karthikcodes6! - Disabled the auto scroll behaviour when the editor has any active selection
- #4650
b6643132
Thanks @e1himself! - Do not disable Grammarly extension in Slate editors
- #4625
e54f2a0e
Thanks @echarles! - insertTextData and insertFragmentData return a boolean (true if some content has been effectively inserted)
- #4627
ec01e75f
Thanks @jameshfisher! - Fixed issues where cursor jumps to wrong location
- #4620
0b59ad54
Thanks @NicklasAndersson! - Support selection in readOnly=true editors.
- #4616
77d9f60a
Thanks @jameshfisher! - Fixed crash on self-deleting void node
- #4540
11ef83b4
Thanks @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.
- #4577
4b2e4000
Thanks @jameshfisher! - Fixed a bug that removed the selection when hovering over a non-selectable DOM element
- #4584
f40e515d
Thanks @jameshfisher! - Fixed bug: setting selection fromcontentEditable:false
element causes crash
- #4304
7ba486aa
Thanks @davidruisinger! - Fixed a bug where text was typed backwards within nested editor
- #4547
677da0ca
Thanks @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
bc85497d
Thanks @VictorBaron! - Fix - delete selected inline void in chrome
- #4549
f9c41a56
Thanks @nemanja-tosic! - Fix deletion of expanded range (#4546)
- #4529
bd80a0b8
Thanks @nemanja-tosic! - Fix erroneous text after native insert
- #4475
c1433f56
Thanks @skogsmaskin! - [slate-react]: fix selection bugs when multiple editors share value
- #4450
220f2d2c
Thanks @neko-neko! - Changed so that the onKeyDown event do not fired while IME converting.
- #4454
d06706c9
Thanks @imdbsd! - Fix to read fragment from data-slate-fragment when application/x-slate-fragment is missing
- #4451
8e4120ae
Thanks @githoniel! - fix IME double input with editor mark
- #4503
2065c5bd
Thanks @bytrangle! - Fix incorrect selection when triple clicking blocks in Editable component
- #4365
906e5af1
Thanks @samarsault! - fix a bug where element selections were not captured by useSelected
- #4175
bde6e804
Thanks @gyh9457! - Fixed a bug in the memoization logic for the leaves of text nodes.
- #4394
01889807
Thanks @jaked! - fix bug where decorate is not called on immediate children of editor
- #4427
3f69a9f3
Thanks @ben10code! - Fix crash when unmounting an editor rendered within a React portal. The issue was arising at unmount time, becausegetRootNode
returned the dettached portal node and it is not an instance ofDocument
orShadowRoot
. As a fix,getDocumentOrShadowRoot
has been refactored to return a root node instead of throwing. In sum, this patch fixes a regression bug introduced by ianstormtaylor#3749
- #4369
c217dbb5
Thanks @thesunny! - Scroll when inserting new text will now scroll parent scrollables
- #4333
e0776c5c
Thanks @dylans! - Allow setFragmentData to work without copy/paste or DnD data structure
- #4331
a3bc97af
Thanks @golota60! - Fix deletion of selected inline void nodes in Safari when presssingbackspace
ordelete
. This is a bug that was originally fixed only for Google Chrome, but the fix also needs to be applied in Safari.
- #4324
61171a23
Thanks @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
-
#4299
2c17e2b7
Thanks @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
Editable
component comes with a set of event handlers that handle typical rich-text editing behaviors (for example, it implements its ownonCopy
,onPaste
,onDrop
, andonKeyDown
handlers).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
Editable
component.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} {/*...*/} /> ) }
- #4266
411e5a19
Thanks @TheSpyder! - Removed accidental bundling ofslate-history
insideslate-react
- #4307
a7e3a181
Thanks @clauderic! - Fix deletion of selected inline void nodes in Chrome. Chrome does not fire abeforeinput
event when deleting backwards within an inline void node, so we need to add special logic to handle this edge-case for Chrome only.
- #4272
294d5120
Thanks @clauderic! - Fix errors accessingglobalThis
in browsers that do not implement it
- #4295
dfc03960
Thanks @dubzzz! - Fix React warnings related toautoCorrect
andautoCapitalize
attributes being passed as a boolean instead of a string.
- #4271
ff267767
Thanks @omerg! - Fixed typo: RenamedtoSlatePoint
argumentextractMatch
toexactMatch
-
#4257
4f0d1120
Thanks @clauderic! - Added support for Android devices using aMutationObserver
based 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.
- #4238
c14e1fbc
Thanks @clauderic! - Fix duplicated content and other bugs related to drag and drop handling
- #4237
623960a7
Thanks @dylans! - Fixed text insertion logic to prevent crashing in newer Firefox versions.
- #4118
6a137633
Thanks @kamilkazmierczak! - Improved detection of legacy browsers that don't have properbeforeinput
support.
- #4190
ea2eefef
Thanks @juliankrispel! - Added arenderPlaceholder
prop to the<Editable>
component for customizing how placeholders are rendered.
- #4157
de5cc7e5
Thanks @githoniel! - Fixed a bug when syncing the selection for IME-based editing.
- #4158
ea6dc089
Thanks @githoniel! - Fixed a bug that resulted in doubly-input characters when using an IME.
- #4211
1c32b97d
Thanks @clauderic! - Collapse expanded selection before handlingmoveWordBackward
(alt + left
) andmoveWordForward
(alt + right
) hotkeys.
- #4219
737aaa9c
Thanks @juliankrispel! - Fixes error that occurs when Editor is rendered inside iframe
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
7283c51f
Thanks @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.
- #4150
bbd7d9c3
Thanks @nivekithan! - Added support for using the newbeforeInput
events 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
bf83f333
Thanks @pubuzhixing8! - Fixed selection updating with IME inputs in browsers that supportbeforeinput
.
- #3652
f3fb40cc
Thanks @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
d5b2d7f5
Thanks @rockettomatooo! - Added invariants when passing invaludvalue
oreditor
props to<Editable>
.
c6002024
- Fixed cursor movement in RTL text.
c6002024
- Fixed a bug in the conversion of DOM points to Slate points.
- #3746
f8be509e
Thanks @gztomas! - Fixed auto-scrolling behavior when a block is bigger than the viewport.
c6002024
- Fixed a bug that occurred when using Babel'sloose
mode.
c6002024
- Fixed deleting void elements when using cut-and-paste.
c6002024
- Fixed a bug that crashed the editor when using IME input.
- #3396
469e6b26
Thanks @cvlmtg! - Fixed allowing theonPaste
handler to be overridden in all browsers.
c6002024
- Fixed internal decoration logic to be faster and require fewer re-renders.
- #3894
7fe41f15
Thanks @msc117! - Fixed an error that happened when selecting void nodes in a read-only editor.
c6002024
- Fixedmove_node
operations 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 preventedisFocused
from updating on certain focus changes.
c6002024
- Fixed IME input to not insert repeated characters.
- #3749
0473d0bf
Thanks @davidruisinger! - Fixes Slate to work with the Shadow DOM.
c6002024
- Fixed deleting by line to account for the line breaks in the browser.