1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-17 04:34:00 +02:00

Do NOT use exact match when updating dom selection (#4304)

* Do NOT use exact match when updating dom selection

* Added changeset
This commit is contained in:
David Ruisinger
2021-09-27 18:05:39 +02:00
committed by GitHub
parent 997fee8b5c
commit 7ba486aa39
2 changed files with 6 additions and 1 deletions

View File

@@ -0,0 +1,5 @@
---
'slate-react': patch
---
Fixed a bug where text was typed backwards within nested editor

View File

@@ -182,7 +182,7 @@ export const Editable = (props: EditableProps) => {
// If the DOM selection is in the editor and the editor selection is already correct, we're done.
if (hasDomSelection && hasDomSelectionInEditor && selection) {
const slateRange = ReactEditor.toSlateRange(editor, domSelection, {
exactMatch: true,
exactMatch: false,
})
if (slateRange && Range.equals(slateRange, selection)) {
return