[openstreetmap/openstreetmap-website] Fix: prevent form submission breaking language selector (#6598) (PR #6599)
Holger Jeromin
notifications at github.com
Mon Dec 8 22:48:11 UTC 2025
@HolgerJeromin commented on this pull request.
> @@ -12,3 +12,14 @@ $(document).on("click", "#select_language_dialog [data-language-code]", function
location.reload();
}
});
+
+// Prevent accidental Enter key submits inside the language dialog
+$(document).on("keydown", "#select_language_dialog", function (e) {
+ if (e.key === "Enter" || e.keyCode === 13) {
We should not introduce handling `keyCode`.
https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/keyCode
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/6599#pullrequestreview-3554401304
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/pull/6599/review/3554401304 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20251208/612eaa96/attachment.htm>
More information about the rails-dev
mailing list