[openstreetmap/openstreetmap-website] Fix: prevent form submission breaking language selector (#6598) (PR #6599)
Parvesh Kumar
notifications at github.com
Mon Dec 8 23:22:37 UTC 2025
prvshkmrin left a comment (openstreetmap/openstreetmap-website#6599)
Thanks for raising these points — they helped me re-evaluate the approach.
- You're right that there's a simpler way to handle this. The actual issue only happens when the search input submits the form, so there's no need to block Enter across the entire dialog.
- It makes more sense to attach the handler directly to the search input instead of intercepting keydown at the dialog level. That keeps the fix much more focused.
- And yes, checking both the key name and the code isn’t necessary. Using `event.key === "Enter"` is enough, and avoids deprecated APIs like `keyCode`.
I'll update the PR so that it only blocks Enter on the search field and uses a clean, modern key check.
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/6599#issuecomment-3629451943
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/pull/6599/c3629451943 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20251208/e164454d/attachment.htm>
More information about the rails-dev
mailing list