Skip to content

Support fastDeleteWord on mobile devices#2875

Merged
Shagen Ogandzhanian (Schahen) merged 5 commits into
jb-mainfrom
sh/fast_delete
Mar 17, 2026
Merged

Support fastDeleteWord on mobile devices#2875
Shagen Ogandzhanian (Schahen) merged 5 commits into
jb-mainfrom
sh/fast_delete

Conversation

@Schahen

@Schahen Shagen Ogandzhanian (Schahen) commented Mar 16, 2026

Copy link
Copy Markdown

Fixes CMP-8262

Testing

gradlew testWeb

Release Notes

Fixes - Web

  • Fix an issue where "fast delete" action removed characters one by one instead of deleting whole words in text fields on iOS

@Schahen Shagen Ogandzhanian (Schahen) changed the title Support fastDeleteWord ob mobile devices Support fastDeleteWord on mobile devices Mar 17, 2026
fun sendKeyboardEvent(keyboardEvent: KeyEvent)
fun sendKeyboardEvent(keyboardEvent: KeyEvent): Boolean

fun currentTextLayoutResult(): TextLayoutResult?

@eymar Oleksandr Karpovich (eymar) Mar 17, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

With this new method the name of this interface ComposeCommandCommunicator does not really fit its purpose.

Maybe it's better to pass just a lambda or fun interface implementation providing the layout result to BackingDomInput, so ComposeCommandCommunicator would have only 1 responsibility.

if (shouldBeProcessed) {
lastProcessedEventIsBackspace = evt.key == "Backspace"
composeSender.sendKeyboardEvent(evt.toComposeEvent())
lastKeydownStatus = ComposeKeyDownStatus(evt, composeSender.sendKeyboardEvent(evt.toComposeEvent()))

@eymar Oleksandr Karpovich (eymar) Mar 17, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

as I see it we only use lastKeydownStatus?.getProcessedEvent().
we are not using it when the event was not processed by Compose.

And the questions are:

  • does ComposeKeyDownStatus need a processed: Boolean field?
  • If there is no need to store the boolean field, can't we simply save the reference to the last processed event? Or use a value class to wrap it if it feels more cleaner?

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.

Oleksandr Karpovich (@eymar) this actually make sense, since this branch is a simplified version of branch where we were just trying to have more information in the processed field - for this PR it's enough to just store just event indeed, let me push this

@Schahen Shagen Ogandzhanian (Schahen) merged commit bced219 into jb-main Mar 17, 2026
17 checks passed
@Schahen Shagen Ogandzhanian (Schahen) deleted the sh/fast_delete branch March 17, 2026 12:56
ApoloApps pushed a commit to ApoloApps/compose-multiplatform-core that referenced this pull request Mar 17, 2026
## Testing
`gradlew testWeb`

## Release Notes
### Fixes - Web
- [CMP-8262](https://youtrack.jetbrains.com/issue/CMP-8262) [Web]
Mobile. iOS. TextField. 'Fast delete' deletes characters one by one
slowly instead of removing words
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.

2 participants