Skip to content

Commit

Permalink
Revert #4749 (#4816)
Browse files Browse the repository at this point in the history
* Revert #4749

See note at #4749 (comment)

* Create olive-bags-talk.md

Add changeset
  • Loading branch information
dylans authored Jan 31, 2022
1 parent 03861af commit 6d62abc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
6 changes: 6 additions & 0 deletions .changeset/olive-bags-talk.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"slate-react": patch
"slate": patch
---

* Revert #4749, DOM & Slate selection are mismatching
7 changes: 2 additions & 5 deletions packages/slate-react/src/components/editable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 6d62abc

Please sign in to comment.