diff --git a/CHANGELOG.md b/CHANGELOG.md index a44a18bbab..5ed854510d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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. diff --git a/src/platform_impl/web/web_sys/canvas.rs b/src/platform_impl/web/web_sys/canvas.rs index 1157a4f2d0..0851d18904 100644 --- a/src/platform_impl/web/web_sys/canvas.rs +++ b/src/platform_impl/web/web_sys/canvas.rs @@ -239,6 +239,11 @@ impl Canvas { event.prevent_default(); } + if event.key().chars().nth(1).is_some() { + // ignore keypress for "Enter" key etc. + return; + } + handler(event::codepoint(&event)); }, ));