WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit 8216512

Browse files
zhi-zhi-zhidylans
andauthored
fix: supplement of (fix: Prevent ReactEditor.toDOMRange crash in setDomSelection #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 <[email protected]>
1 parent 49da0df commit 8216512

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

.changeset/gold-tomatoes-grab.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'slate-dom': patch
3+
---
4+
5+
fix: additional fix for previous fix: Prevent ReactEditor.toDOMRange crash in setDomSelection #5741

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,12 @@ export const withDOM = <T extends BaseEditor>(
210210
case 'remove_node':
211211
case 'merge_node':
212212
case 'move_node':
213-
case 'split_node': {
213+
case 'split_node':
214+
case 'insert_text':
215+
case 'remove_text':
216+
case 'set_selection': {
217+
// FIXME: Rename to something like IS_DOM_EDITOR_DESYNCED
218+
// to better reflect reality, see #5792
214219
IS_NODE_MAP_DIRTY.set(e, true)
215220
}
216221
}

0 commit comments

Comments
 (0)