Open egorikftp opened 2 months ago
Hi @egorikftp - yep, we've tried to introduce basic support for virtual keyboard but missed a couple of very serious things to consider. In next beta this will be addressed in desktop browser and one beta release after that in mobile browsers as well. Will close this issue whenever it will be completely gone.
Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.
Describe the bug Desktop platform provides API to listen global key events inside Window function
On Wasm there is no such API, but since 1.6.10-beta01 (https://github.com/JetBrains/compose-multiplatform/issues/2296, https://github.com/JetBrains/compose-multiplatform/issues/3644) we can handle it following way
But in this case, if we open some nested screen, we lose focus and key events not passes to root modifier until we make root function focused again.
In demo page focuses on start and receive key events, after losing focus doesn't receive any events
https://github.com/JetBrains/compose-multiplatform/assets/16294951/413e078f-362c-4d0a-8f69-fe7b24ebda02
For testing purpose we can make this hack, but it break all the app logic 🙂
Can it be done without manual focus manipulation?
Affected platforms
Kotlin version: 2.0.0-RC1 Compose Multiplatform version: 1.6.10-beta01