Commit d58df45
zenggenfa
fix(slate-react): prevent premature flush during composition for Android handwriting input
Fixes #5979
On Android devices, handwriting input triggers compositionStart per stroke.
The RestoreDOM component was restoring childList mutations during composition,
which interrupted the IME session and caused the first stroke to be committed
prematurely (e.g., writing '我' would produce '一我').
The fix skips all DOM restoration during composition in RestoreDOM. This
preserves the user's input state while allowing Slate state updates and
onChange to fire normally.1 parent addf0c5 commit d58df45
File tree
2 files changed
+20
-1
lines changed- .changeset
- packages/slate-react/src/components/restore-dom
2 files changed
+20
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
Lines changed: 10 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
35 | 44 | | |
36 | 45 | | |
37 | 46 | | |
| |||
0 commit comments