Page MenuHomePhabricator

Ensure focus returns to appropriate when pinnable elements are pinned/unpinned
Closed, ResolvedPublic3 Estimated Story Points

Description

Description

Created as a result of AFB accessibility testing results T323634

HIGH When activating the Hide button, JAWS focus is taken to the top of the page.
Recommendation: JAWS focus should land on the "Show Contents" toggle
WCAG 2.1 References 
[[ https://www.w3.org/WAI/WCAG21/Understanding/focus-order.html | 2.4.3 Focus Order (Level A) ]]

AC

  • When "move to sidebar" is clicked, focus should be placed on that pinnable element's pin/unpin toggle button
  • When "hide" is clicked, focus should be placed on either the pinnable element's dropdown trigger button, or the dropdown should be open and focus is on the pinnable element's pin/unpin toggle buttons

QA Results - Beta

ACStatusDetails
1T325020#8586889
2T325020#8586889

QA Results - Prod

ACStatusDetails
1T325020#8606743
2T325020#8606743

Event Timeline

Estimation summary: This will likely be a JavaScript fix which focuses the relevant elements. May require adding HTML element IDs to support this work. Jan said this pattern is called "focus trapping". However Nick and Bernard say it isn't and this is more to do with the initial focus.

LGoto set the point value for this task to 3.Jan 12 2023, 6:24 PM

Change 884366 had a related patch set uploaded (by Bernard Wang; author: Bernard Wang):

[mediawiki/skins/Vector@master] Add setFocusToToggleButton function to pinnableElement.js

https://gerrit.wikimedia.org/r/884366

bwang removed bwang as the assignee of this task.Jan 27 2023, 7:28 PM
bwang moved this task from Doing to Code Review on the Web-Team FY2022-23 Q3 Sprint 1 board.

Change 884366 merged by jenkins-bot:

[mediawiki/skins/Vector@master] Add setFocusToToggleButton function to pinnableElement.js

https://gerrit.wikimedia.org/r/884366

bwang moved this task from QA to Code Review on the Web-Team FY2022-23 Q3 Sprint 2 board.
bwang added a subscriber: Edtadros.

Change 885878 had a related patch set uploaded (by Bernard Wang; author: Bernard Wang):

[mediawiki/skins/Vector@master] Add setFocusToToggleButton function to pinnableElement.js

https://gerrit.wikimedia.org/r/885878

Change 885878 merged by jenkins-bot:

[mediawiki/skins/Vector@master] Add setFocusToToggleButton function to pinnableElement.js

https://gerrit.wikimedia.org/r/885878

Test Result - Beta

Status: ✅ PASS
Environment: beta
OS: macOS Ventura
Browser: Chrome
Device: MBP
Emulated Device:NA

Test Artifact(s):

QA Steps

✅ AC1: When "move to sidebar" is clicked, focus should be placed on that pinnable element's pin/unpin toggle button
✅ AC2:When "hide" is clicked, focus should be placed on either the pinnable element's dropdown trigger button, or the dropdown should be open and focus is on the pinnable element's pin/unpin toggle buttons

Screen Recording 2023-02-03 at 6.19.26 PM.mov.gif (972×1 px, 830 KB)

Screen Recording 2023-02-03 at 6.19.05 PM.mov.gif (972×1 px, 873 KB)

Screen Recording 2023-02-03 at 6.20.17 PM.mov.gif (972×1 px, 982 KB)

Test Result - Prod

Status: ✅ PASS
Environment: enwiki
OS: macOS Ventura
Browser: Chrome
Device: MBP
Emulated Device:NA

Test Artifact(s):

QA Steps

✅ AC1: When "move to sidebar" is clicked, focus should be placed on that pinnable element's pin/unpin toggle button
✅ AC2:When "hide" is clicked, focus should be placed on either the pinnable element's dropdown trigger button, or the dropdown should be open and focus is on the pinnable element's pin/unpin toggle buttons

Screen Recording 2023-02-10 at 4.38.06 PM.mov.gif (986×1 px, 883 KB)

Screen Recording 2023-02-10 at 4.38.55 PM.mov.gif (986×1 px, 1005 KB)

Screen Recording 2023-02-10 at 4.38.33 PM.mov.gif (986×1 px, 1 MB)