Support fastDeleteWord on mobile devices#2875
Conversation
| fun sendKeyboardEvent(keyboardEvent: KeyEvent) | ||
| fun sendKeyboardEvent(keyboardEvent: KeyEvent): Boolean | ||
|
|
||
| fun currentTextLayoutResult(): TextLayoutResult? |
There was a problem hiding this comment.
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())) |
There was a problem hiding this comment.
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
ComposeKeyDownStatusneed aprocessed: Booleanfield? - 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?
There was a problem hiding this comment.
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
## 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
Fixes CMP-8262
Testing
gradlew testWebRelease Notes
Fixes - Web