- #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.