Skip to content

Commit

Permalink
fix: supplement of (fix: Prevent ReactEditor.toDOMRange crash in setD…
Browse files Browse the repository at this point in the history
…omSelection #5741) (#5792)

* fix: supplement of (fix: Prevent ReactEditor.toDOMRange crash in setDomSelection #5741)

* Update packages/slate-dom/src/plugin/with-dom.ts

* Update packages/slate-dom/src/plugin/with-dom.ts

* Create gold-tomatoes-grab.md

* Update packages/slate-dom/src/plugin/with-dom.ts

* Update packages/slate-dom/src/plugin/with-dom.ts

---------

Co-authored-by: Dylan Schiemann <dylan@dojotoolkit.org>
  • Loading branch information
zhi-zhi-zhi and dylans authored Jan 27, 2025
1 parent 49da0df commit 8216512
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/gold-tomatoes-grab.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'slate-dom': patch
---

fix: additional fix for previous fix: Prevent ReactEditor.toDOMRange crash in setDomSelection #5741
7 changes: 6 additions & 1 deletion packages/slate-dom/src/plugin/with-dom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,12 @@ export const withDOM = <T extends BaseEditor>(
case 'remove_node':
case 'merge_node':
case 'move_node':
case 'split_node': {
case 'split_node':
case 'insert_text':
case 'remove_text':
case 'set_selection': {
// FIXME: Rename to something like IS_DOM_EDITOR_DESYNCED
// to better reflect reality, see #5792
IS_NODE_MAP_DIRTY.set(e, true)
}
}
Expand Down

0 comments on commit 8216512

Please sign in to comment.