Skip to content
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

Keyboard events don't work in web app #2296

Closed
mykola-dev opened this issue Sep 7, 2022 · 3 comments
Closed

Keyboard events don't work in web app #2296

mykola-dev opened this issue Sep 7, 2022 · 3 comments

Comments

@mykola-dev
Copy link

Modifier.onKeyEvent and Modifier.onPreviewKeyEvent do nothing in browser (tried chrome and firefox).
Project to reproduce: https://github.com/mykola-dev/Tetris/blob/master/src/commonMain/kotlin/ds/tetris/ui/TetrisGame.kt#L65
arrows keys work fine on android and desktop.

@dhakehurst
Copy link

I would expect this to stop all key presses from doing anything.
In fact I would expect it to stop all keys from doing anything with only the onPreviewKeyEvent
however, all key presses still seem to enter text into the TextField !
(On browser platform)

        TextField(
            value = text,
            modifier = Modifier
                .onPreviewKeyEvent { true }
                .onKeyEvent { true },
            onValueChange = {
                text = it
            }
        )

@eymar
Copy link
Member

eymar commented Apr 9, 2024

fixed in 1.6.10-dev1571

eymar added a commit to JetBrains/compose-multiplatform-core that referenced this issue Apr 9, 2024
@eymar eymar closed this as completed Apr 9, 2024
@okushnikov
Copy link
Collaborator

Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.

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

No branches or pull requests

4 participants