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

web: Fix Enter key being handled as character E #2673

Conversation

johanhelsing
Copy link
Contributor

When with_prevent_default is set to false, browsers will send keypress events for the enter key, with event.key set to Enter.

Ignore it by checking the length of the key string.

  • Tested on all platforms changed
  • Added an entry to CHANGELOG.md if knowledge of this change could be valuable to users
  • [] Updated documentation to reflect any user-facing changes, including notes of platform-specific behavior
  • [ ] Created or updated an example program if it would help users understand this functionality
  • [ ] Updated feature matrix, if new features were added or implemented

When with_prevent_default is set to false, browsers will send keypress
events for the enter key, with event.key set to Enter.

Ignore it by checking the length of the key string.
@johanhelsing
Copy link
Contributor Author

johanhelsing commented Feb 6, 2023

Minimal test case: https://github.com/johanhelsing/winit/pull/new/with-prevent-default-receive-characters

Run the web example and press enter. Observe received character "E" in the log.

@johanhelsing
Copy link
Contributor Author

@maroider are you happy with this as is, should I rebase to fix the conflicts with the changelog?

@johanhelsing
Copy link
Contributor Author

@daxpedda, @notgull, @ryanisaacg you are listed as contributors/experts for wasm

Do you either of you have the time to review this, and/or know who I could involve to get this PR moving?

@daxpedda
Copy link
Member

daxpedda commented May 11, 2023

There is currently a merge freeze until we are done with #2789, I will review this issue if it's still one afterwards.

(I somehow got no notification for this message)

@kchibisov
Copy link
Member

Mentioned patch merged, needs re-evaluation.

@daxpedda
Copy link
Member

This can be closed, with #2662 this isn't an issue anymore, just tested it.

@kchibisov kchibisov closed this May 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

5 participants