Unexpected focus when using a link to an element on the same page
Categories
(Core :: DOM: UI Events & Focus Handling, defect, P3)
Tracking
()
People
(Reporter: william, Unassigned)
Details
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36 Edg/90.0.818.66
Steps to reproduce:
- Visit https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a
- Press the Tab key twice to highlight Skip to search
- Press Enter to use the shortcut
Actual results:
The focus has been moved (presumably to the search field), but no element is interactive. If I press Tab again focus is moved to the next focusable element (in this case the magnifying glass). If I press Shift+Tab focus is moved to the previous focusable element (in this case Feedback in the menu).
Expected results:
In Chromium based browsers and Internet Explorer 11 the same steps puts the focus in the search field and the search field is interactive (ready for text input).
In this case MDN is just an example. I was made aware of this bug by a colleague in QA on a site that I maintain.
In our case the shortcut links to a <button>. Focus is moved to the button and it is interactive in Edge, Chrome, and IE11, but not in Firefox.
Tested in Nightly 90.0a1 (2021-05-26) (64-bit) with all extensions turned off. Also tested in Firefox 88.0.1 (64-bit). Both on Windows 10.
Comment 2•3 years ago
|
||
The Bugbug bot thinks this bug should belong to the 'Core::DOM: UI Events & Focus Handling' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.
Comment 3•3 years ago
|
||
Masayuki, do you happen to know where we're supposed to be handling the case of navigating to a text field by URL anchor?
Comment 4•3 years ago
|
||
I think this is bug 1484185, but undupe if not the case.
Description
•