Page MenuHomePhabricator

[Firefox; Vector 2022] When two links have identical access keys focuses link instead of triggering it
Closed, DuplicatePublic1 Estimated Story PointsBUG REPORT

Description

Related: T321428, T329318

Steps to replicate the issue (include links if applicable):

  • Press access key for my user page (Alt+Shift+. on Firefox)

What happens?: Link to my user page in top-right corner is focused

What should have happened instead?: Link to my user page in top-right corner is clicked

Software version (skip for WMF-hosted wikis like Wikipedia): testwiki. MediaWiki 1.40.0-wmf.2 (e31f436)

Other information (browser name/version, screenshots, etc.): Firefox 101.0

Developer notes

The issue here is that there are two elements with the same access key. I suggest 1 of 2 solutions:

  1. Access key element

In JavaScript iterate through all elements with access keys and remove the access key and create a unique link at the bottom of the page with the access key. These should not be hidden in the DOM so that they are accessible to the keyboard. This element could be given a heading "Keyboard Shortcuts" in case we wanted it to be discoverable by screenreaders.

  1. matchMedia

Since Vector is a special case here we could add JavaScript which manages the access keys, making sure the accesskey attribute is removed from any links that get collapsed. We have classes like user-links-collapsible-item that make this easier.

Event Timeline

Jdlrobson renamed this task from Access key for my user page focuses link but doesn't trigger it to [Firefox] Access key for my user page focuses link but doesn't trigger it.Sep 23 2022, 4:38 PM

Is this a bug for Vector 2022 or Vector?
I can confirm behaviour in Firefox on Vector 2022 but not Vector.
Works on Chrome.
Seems to be this way because there are two elements with that access key in the page and this is just how Firefox handles that.

Jdlrobson renamed this task from [Firefox] Access key for my user page focuses link but doesn't trigger it to [Firefox] When two links have identical access keys focuses link instead of triggering it.Sep 23 2022, 4:43 PM
Aklapper renamed this task from [Firefox] When two links have identical access keys focuses link instead of triggering it to [Firefox; Vector 2022] When two links have identical access keys focuses link instead of triggering it.Sep 25 2022, 10:55 AM
Jdlrobson set the point value for this task to 1.Sep 29 2022, 5:30 PM
Jdlrobson updated the task description. (Show Details)

After talking to @Jdrewniak I'm favouring the generic approach in developer notes #1 as it creates a generic solution for this issue that doesn't need to revised at a later date.

I'm still questioning the need to address this at all. As I understand it this is due to FF's implementation of accesskeys, which could be considered a browser bug. I also think the current experience is a relatively graceful failure, it still places focus on the link. Considering the inconsistencies and issues with access keys (MDN generally advises not to use accesskeys), I'm unsure if it's worth adding JS to handle this specific case.

@ovasileva what do you think? Should we consider this a bug/feature with Firefox and decline (with upstream bug report) or try to fix it our end?

Apparently this behaviour is intentional in Firefox and it doesn't look like it will change.