Skip to content

Fix symbols duplication on keyboard paste hotkeys#3047

Closed
Andrei Salavei (ASalavei) wants to merge 16 commits into
jb-mainfrom
andrei.salavei/fix-paste-duplications
Closed

Fix symbols duplication on keyboard paste hotkeys#3047
Andrei Salavei (ASalavei) wants to merge 16 commits into
jb-mainfrom
andrei.salavei/fix-paste-duplications

Conversation

@ASalavei

@ASalavei Andrei Salavei (ASalavei) commented May 13, 2026

Copy link
Copy Markdown

Remove keyboard events handling from the text input view.
Skip edit menu events if there is an active key press detected.
Add logic that simulates key up events for started events with detached views - these events are not propagated by iOS.
Add ability to test key presses on simulator environment.
Add tests for key presses and text edit operations with hotkeys.

Fixes https://youtrack.jetbrains.com/issue/CMP-8355/iOS-btf2-duplicate-symbols-after-paste-via-keyboard

QA Notes

Issue where Compose may duplicate key events during text input

  • Open the Demo App
  • Create Box with Text Field inside
  • Add onKeyEvent modifier for Box
  • Type with keyboard
  • Ensure the onKeyEvent registers single event for every keystroke

Fix symbols duplication on keyboard paste hotkeys

  • Open the Demo App
  • Open any Text Field
  • Copy some text, double tap on TextField to see Paste action
  • Press cmd+v on keyboard to perform paste action
  • Ensure there is no duplicates in the pasted text
  • Do the this test for BTF 1 and BTF 2

Issue where the Compose does not receive key events when initially created.

  • Add focusable element that can handle onKeyEvent on the first application screen
  • Launch the app and type on keyboard
  • onKeyEvent should handle key events

Release Notes

Fixes - iOS

  • Fix an issue where Compose may duplicate key events during text input.
  • Fix symbols duplication on keyboard paste hotkeys.
  • Fix an issue where the Compose does not receive key events when initially created.
  • Fix an issue where Compose may not propagate keys up events after focus change.

@ASalavei Andrei Salavei (ASalavei) marked this pull request as draft May 18, 2026 14:28
@ASalavei Andrei Salavei (ASalavei) marked this pull request as ready for review May 19, 2026 20:27
@ASalavei Andrei Salavei (ASalavei) marked this pull request as draft May 20, 2026 09:14
# Conflicts:
#	compose/ui/ui/src/iosMain/kotlin/androidx/compose/ui/platform/UIKitTextInputService.ios.kt
#	compose/ui/ui/src/iosMain/kotlin/androidx/compose/ui/scene/ComposeSceneMediator.ios.kt
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.

1 participant