Commit 7d5b051
committed
fix: respect suppressThrow in toSlatePoint findPath calls
When toSlatePoint is called with suppressThrow: true (e.g., from
toSlateRange during selection change handling), internal findPath calls
could still throw "Unable to find the path for Slate node" errors
during component unmount when node references become stale.
Wrap both findPath calls in try-catch blocks that return null when
suppressThrow is enabled, matching the existing error handling pattern
in the rest of the function.
Based on upstream slate-dom PR #6004.1 parent 2b7b231 commit 7d5b051
File tree
2 files changed
+24
-5
lines changed- .changeset
- packages/editor/src/slate-dom/plugin
2 files changed
+24
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
879 | 879 | | |
880 | 880 | | |
881 | 881 | | |
882 | | - | |
883 | | - | |
884 | | - | |
885 | | - | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
886 | 892 | | |
887 | 893 | | |
888 | 894 | | |
| |||
905 | 911 | | |
906 | 912 | | |
907 | 913 | | |
908 | | - | |
| 914 | + | |
| 915 | + | |
| 916 | + | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
909 | 923 | | |
910 | 924 | | |
911 | 925 | | |
| |||
0 commit comments