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/[email protected]>
_______________________________________________
rails-dev mailing list
[email protected]
https://lists.openstreetmap.org/listinfo/rails-dev

Reply via email to