[openstreetmap/openstreetmap-website] Remove search input autofocus workaround for old browsers (PR #5899)

Anton Khorev notifications at github.com
Sun Apr 6 11:21:54 UTC 2025


The workaround was added in https://github.com/openstreetmap/openstreetmap-website/commit/9cc9a0098840363b6497337951b53aa583f4aa44. It uses [deprecated .focus() jQuery function](https://api.jquery.com/focus-shorthand/).

It's also not necessary because [browsers supported autofocus on input for a long time](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/autofocus#browser_compatibility). Except maybe on iOS but we may not want anything to happen on mobile devices. In fact I'm going to do another pull request that prevents virtual keyboard from popping up on certain focus operations.
You can view, comment on, or merge this pull request online at:

  https://github.com/openstreetmap/openstreetmap-website/pull/5899

-- Commit Summary --

  * Remove search input autofocus workaround for old browsers

-- File Changes --

    M app/assets/javascripts/index.js (3)

-- Patch Links --

https://github.com/openstreetmap/openstreetmap-website/pull/5899.patch
https://github.com/openstreetmap/openstreetmap-website/pull/5899.diff

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

Message ID: <openstreetmap/openstreetmap-website/pull/5899 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20250406/95795709/attachment.htm>


More information about the rails-dev mailing list