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

fix: correct dirty path update for Text nodes (#5842)

* fix: correct dirty path update for Text nodes

Previously, the condition used was "if (!Text.isText)" without passing the node, which always evaluated to false. This caused the code to always take the branch intended for non-Text nodes, even for Text nodes. The fix now correctly checks "if (Text.isText(node))" to determine if the node is a Text node. Text nodes, which have no children, will now correctly add only their own path, while non-Text nodes continue to have all their descendant paths added. This change ensures that the dirty path update logic behaves as intended.

* Add changeset

---------

Co-authored-by: Dylan Schiemann <dylan@dojotoolkit.org>
This commit is contained in:
wkq
2025-04-15 23:42:42 +08:00
committed by GitHub
parent 63c0db5b86
commit 463ef3a650
2 changed files with 6 additions and 1 deletions

View File

@@ -0,0 +1,5 @@
---
'slate': patch
---
fix: correct dirty path update for Text nodes