-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
iOS Keyboard Broken with readOnly
will show/hide in loop
#5088
Comments
Hm.. it should be there 🤔 I'll take a look, thanks for the report |
This also is slightly broken on 1.6.10/11, but no where near as janky as this. On 1.6.1x it will show the keyboard once but then not again, seems like on iOS it doens't know who should hold focus causing this back and forth. |
Broken on 1.6.1x so downgrading again... |
Note, you won't see this on an emulator, you need a physical device. As the emulators are faster/don't show keyboard on focus by default |
Well the more I test the more I realize dropdown with keyboard is just plain broken on iOS, basically the popup always steals the focus so the keyboard auto closes.
Remove the Seems like compose compiler will start writing the text view in a way where it aways will recompose the textfield causing the keyboard not to be able to focus. This happens on 1.6.x on KT 1.9.23 forward |
Created a test project for you, this is actually broken on the emulator too. What is interesting is I'm pretty sure it works first time from a clean, then you start changing stuff and then it breaks. It could be completely unrelated to menuAnchor an a iOS compile compiler issue where it's incorrectly invalidating the text field. (Cleaning all caches doesn't fix it, so not sure that theory has any validity) |
Another random note that leads me to belive focus/recompose issue, if you comment out the |
For 1.6.x with an editable text field inside dropdown it was tracked in #4782 and already fixed. See my comment #4782 (comment) with explanation what was that. For 1.7.0-alpha01 - I've checked in our samples and in your project and wasn't able to reproduce it. It works as expected in both editable and noneditable variants. Since the shared project contains an issue with the EDITABLE field from 1.6 that was already resolved and the initial message was about NON editable fields from 1.7, I kindly ask you to provide a project with reproduction for future investigation - the code snippet from the first message works fine. @ASalavei could you please check if it's related to your change about an edit menu? |
Updated to 1.7.x with the readOnly issue. Tap Read only field for focus, then tap again, they keyboard starts going crazy RPReplay_Final1720625412.MP4 |
readOnly
will show/hide in loop
@MatkovIvan , it looks like this line does the party: https://github.com/JetBrains/compose-multiplatform-core/blob/0ff7bcc245689fc6e3a7c5b2bf2cc46bca684280/compose/ui/ui/src/uikitMain/kotlin/androidx/compose/ui/platform/UIKitTextInputService.uikit.kt#L305 However, I can see the difference in keyboard appearing behavior. This sample behaves differently on iOS and Android. It looks like our |
Thanks for investigation. This is from JetBrains/compose-multiplatform-core#1269. Then, reassigning to @mazunin-v-jb |
Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks. |
Fixed the keyboard appearing in SelectionContainer in iOS <!-- Optional --> Fixes: JetBrains/compose-multiplatform#4986 https://youtrack.jetbrains.com/issue/CMP-1554/iOS-Selection-Container-shows-keyboard-while-selecting-text JetBrains/compose-multiplatform#5088 ## Testing Manual. Open Test App, go Components -> Selection, double tap any selectable text, on-screen keyboard shouldn't appear. ## Release Notes <!-- Optional, if omitted - won't be included in the changelog Sections: - Highlights - Known issues - Breaking changes - Features - Fixes Subsections: - Multiple Platforms - iOS - Desktop - Web - Resources - Gradle Plugin --> ### Fixes - iOS - Fixed the keyboard appearing when selecting from SelectionContainer ## Google CLA You need to sign the Google Contributor’s License Agreement at https://cla.developers.google.com/. This is needed since we synchronise most of the code with Google’s AOSP repository. Signing this agreement allows us to synchronise code from your Pull Requests as well.
OK looks like this was fixed by JetBrains/compose-multiplatform-core#1448 in 1.7.0-alpha02 |
Focus is not respected for readOnly textfields on iOS causing the second tap to cause an infinate loop of showing/hiding the keyboard, see video.
On older versions, readonly won't show the keyboard. But it also will show then hide if trying to create a filter style drop down.Looking at the errors looks like the textview get incorrectly recomposed or focus removed so iOS removes the keyboard:
Affected platforms
Versions
Libraries:
Kotlin version: 2.0.0,1.9.23
To Reproduce
Watch the video closely, you tap once to show the drop down, then tap to close it, the next time you tap to reopen the same drop down it start going crazy.
Expected behavior
Keyboard should not show, second click should hide the popup (as should scrolling etc)
RPReplay_Final1720539286.mov
Updated, tried 1.6.1x+ and broken on there too. Downgrading to 1.6.1 again...
The text was updated successfully, but these errors were encountered: