Skip to content

[web] in certain cases deleteContentBackward behaves as deleteWordBackward#3104

Open
Shagen Ogandzhanian (Schahen) wants to merge 7 commits into
jb-mainfrom
sh/CMP-10086-delete-word-on-delete-content
Open

[web] in certain cases deleteContentBackward behaves as deleteWordBackward#3104
Shagen Ogandzhanian (Schahen) wants to merge 7 commits into
jb-mainfrom
sh/CMP-10086-delete-word-on-delete-content

Conversation

@Schahen

@Schahen Shagen Ogandzhanian (Schahen) commented Jun 8, 2026

Copy link
Copy Markdown

The goal of this PR is to treat deleteContentBackward as deleteWordBackward when we ran out of other options to "guess" what happened.

It also adds dedicated web regression coverage for the repeated-Backspace deleteContentBackward path that should fall back to word deletion.

Testing

Manual + gradlew testWeb

Release Notes

Fixes - Web

  • CMP-10086 [Web] Mobile. iOS. Cangjie - Traditional. 'Fast delete' doesn't work correctly

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adjusts the web NativeInputEventsProcessor to better handle “fast delete” scenarios by treating certain beforeinput deleteContentBackward events like deleteWordBackward when backspace-repeat suggests a long-press/accelerated delete, improving behavior for affected mobile keyboard layouts (CMP-10086).

Changes:

  • Extracted a shared createDeleteWordCommand() helper to build a word-backward deletion EditCommand from current text layout.
  • Reused the helper for deleteWordBackward handling and as a fallback path for deleteContentBackward when the last processed keydown was a repeating Backspace.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +201 to +202
// certain keyboard layout trigger deleteContentBackward on fast delete
// https://youtrack.jetbrains.com/issue/CMP-10086
Comment on lines +160 to +164
private fun InputEventExt.createDeleteWordCommand(): EditCommand? {
val shouldTriggerDelete = when {
lastProcessedKeydown?.isBackspace() != true -> false
lastProcessedKeydown?.repeat == true -> true
else -> false

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot check latest revisions

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The latest revision addresses this thread: commit d9634e95 adds deletePrevWordVirtualMiddle_viaDeleteContentBackward_CMP_10086 in DeleteWordBackwardTests, covering the repeated-Backspace + deleteContentBackward path. I didn’t make further code changes here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants