]> git.openstreetmap.org Git - rails.git/commit
Avoid using positive tabindexes
authorAndy Allan <git@gravitystorm.co.uk>
Wed, 18 Feb 2026 18:41:31 +0000 (18:41 +0000)
committerAndy Allan <git@gravitystorm.co.uk>
Wed, 18 Feb 2026 18:41:31 +0000 (18:41 +0000)
commited50061402fda90206479820b515a4a57636b080
treea56deed3c15c17709f51ed81d0d615c9ceb01c97
parentec7af603382db0067022b6fb853900aecc7087ea
Avoid using positive tabindexes

The use of positive tabindexes is widely discouraged. Instead, we
should order the elements of the page in the same order as they
are displayed, which they are already.

Previously the tab indexes did match the order that these elements
were shown on the page, but the lack of tabindexes on certain other
elements was used to "skip over" things like explanatory links
in forms. This made these other elements hard to focus, and meant that
overall the focus skipped around the page unintuitively.

It is less confusing for keyboard users if the focus just moves around
in the same order that the elements are shown on the page, which is
also the same order they appear in the html.

See https://herb-tools.dev/linter/rules/html-no-positive-tab-index
and the list of references on that page, for further discussion.
app/views/layouts/map.html.erb
app/views/sessions/new.html.erb
app/views/users/new.html.erb