Repository navigation
Conversation
Deletions that arrive as input/compositionupdate events are applied by
applyComposition, which called editor.remove() directly, so
commands.on("exec") never saw them, while insertions from the same events
are dispatched as the insertstring command.
Route that removal through the command manager, reusing the existing
backspace/del commands depending on which side the range was extended.
Fixes ajaxorg#5304
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #6010 +/- ##
==========================================
- Coverage 93.92% 93.92% -0.01%
==========================================
Files 647 647
Lines 140792 140835 +43
Branches 14784 14768 -16
==========================================
+ Hits 132237 132273 +36
- Misses 8555 8562 +7
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Merging, but this may interfere with composition on desktop, in which case we will have to limit this with |
|
Checked the composition risk instead of guessing. Short version: on every desktop IME path I can replay here, routing the removal through the command manager changes nothing except that the extra event fires, so What I ran. Cloned master at Desktop Chinese IME, Backspace pressed inside an active composition (a trimmed replay of the Composition stays open, the marker keeps tracking, and the removal lands inside the same undo group. The entire diff between I also ran it with Popup survives, textarea and document stay in sync. I also re-checked the PR body's claim that the event is informational: with a listener calling If you do add the guard, two traps.
so
What does work locally: carry the flag on the composition descriptor Not verified: there is no real desktop browser or physical IME on this machine, so all of the above is replay of this repo's recorded sequences, not a live macOS/Windows IME session. If composition does break for someone on a real desktop IME, these traces point at a consumer's |
Issue #, if available: #5304
Description of changes:
Soft keyboard and IME deletions arrive as
input/compositionupdateand are applied byapplyComposition, which calledthis.remove()directly; insertions from the same events go out asinsertstring. Socommands.on("exec", ...)sees typing but never deletion. Replaying the sequence recorded intest: mobile text deletion: insert → 2 exec events, delete → 0, desktop Backspace → 1. This routes that removal through the command manager asbackspace/del.Limits I know of: the event is informational, cancelling it does not cancel the deletion; with multiple cursors
forEachSelection's guard skips the command itself,execstill fires and the text is unchanged; composition insertions still bypass commands. No Android device here, so I reproduced with this repo's recorded sequences, not the reporter's Gboard one; both paths reach the same line.User-facing changes:
exec/afterExecnow fire for these deletions, with the command names desktop keys use. Text and cursor position unchanged in every case I measured.Tests: two tests in
textinput_test.jsreplaying recorded deletions. 1498 passing, eslint + typecheck clean. Reverting the one-line change turns both red.By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
ace.d.tsunchanged).Open kitchen-sink @ 96546741a401764548be88e9a759eb2cbbaa1f7b