[openstreetmap/openstreetmap-website] Fix: prevent form submission breaking language selector (#6598) (PR #6599)

Parvesh Kumar notifications at github.com
Mon Dec 8 23:17:28 UTC 2025


@prvshkmrin 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) {

Thanks for pointing that out — you're right, `keyCode` is deprecated and shouldn't be introduced here.

I’ll update the PR to remove the `keyCode` check and switch to using `event.key`, which is the recommended modern approach.

Thanks for the guidance!


-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/6599#discussion_r2600461658
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/pull/6599/review/3554491202 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20251208/b3aa5772/attachment.htm>


More information about the rails-dev mailing list