1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-04-21 13:51:59 +02:00
* Revert 

See note at https://github.com/ianstormtaylor/slate/pull/4749#issuecomment-1025742142

* Create olive-bags-talk.md

Add changeset
This commit is contained in:
Dylan Schiemann 2022-01-31 07:57:41 -07:00 committed by GitHub
parent 03861afc62
commit 6d62abc103
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 5 deletions
.changeset
packages/slate-react/src/components

@ -0,0 +1,6 @@
---
"slate-react": patch
"slate": patch
---
* Revert #4749, DOM & Slate selection are mismatching

@ -214,11 +214,8 @@ export const Editable = (props: EditableProps) => {
// Otherwise the DOM selection is out of sync, so update it.
state.isUpdatingSelection = true
const newDomRange =
selection &&
hasDomSelectionInEditor &&
ReactEditor.toDOMRange(editor, selection)
const newDomRange = selection && ReactEditor.toDOMRange(editor, selection)
if (newDomRange) {
if (Range.isBackward(selection!)) {
domSelection.setBaseAndExtent(