fix(editor): fire correct behavior events for Android diff-path deletions#2268
Closed
christianhg wants to merge 1 commit intomainfrom
Closed
fix(editor): fire correct behavior events for Android diff-path deletions#2268christianhg wants to merge 1 commit intomainfrom
christianhg wants to merge 1 commit intomainfrom
Conversation
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
8a3b164 to
7503c5f
Compare
When deleteContentBackward or deleteContentForward fires on Android, the
Android Input Manager previously stored a text diff instead of scheduling
an action. When the diff was flushed, it sent
{type: 'delete', direction: 'forward'} — NOT delete.backward or
delete.forward. This meant any behavior listening on those specific event
types never fired on Android.
The fix: remove the diff path for deleteContentBackward and
deleteContentForward entirely. Always use scheduleAction for these input
types, which sends the correct delete.backward / delete.forward behavior
events. The diff path remains in use for insertions where it works
correctly.
7503c5f to
a56a7ed
Compare
This was referenced Feb 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix: Fire correct behavior events for Android deletions
Problem
On Android, the
deleteContentBackwardanddeleteContentForwardinput types were using the "diff path" — an optimization that batches rapid text changes into a single diff and flushes them later. This works great for insertions, but for deletions the flush sends{type: 'delete', direction: 'forward'}regardless of the original input type. This means any behavior listening fordelete.backwardordelete.forwardnever fires.Fix
Remove the diff path for
deleteContentBackwardanddeleteContentForwardentirely. Always usescheduleActionfor these input types, which sends the correctdelete.backward/delete.forwardbehavior events.The diff path remains in use for insertions (
insertText,insertCompositionText, etc.) where it works correctly.Changes
android-input-manager.ts: Remove thestoreDiffbranches fromdeleteContentBackwardanddeleteContentForwardcases — always usescheduleActioninsteadisDOMSelectionimport (was only used in the deleteddeleteContentBackwarddiff path)