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

Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ And please only add new entries to the top of this list, right below the `# Unre

# Unreleased

- On Web, fix Enter key being handled as the character E if `with_prevent_default` is false.

# 0.28.1

- On Wayland, fix crash when dropping a window in multi-window setup.
Expand Down
5 changes: 5 additions & 0 deletions src/platform_impl/web/web_sys/canvas.rs
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,11 @@ impl Canvas {
event.prevent_default();
}

if event.key().len() > 1 {
// ignore keypress for "Enter" key etc.
return;
}
johanhelsing marked this conversation as resolved.
Show resolved Hide resolved

handler(event::codepoint(&event));
},
));
Expand Down