umbraco / Umbraco-CMS.Accessibility.Issues

6 stars 1 forks source link

Packages - Modal - Closing returns focus to the top of the page #63

Open umbrabot opened 2 years ago

umbrabot commented 2 years ago

Open package (Umbraco forms) - Open printscreen modal - closing modal returns keyboard focus to the top of the page

Steps to replicate:

  1. Navigate to packages
  2. Open any of the packages for information
  3. View the prints modal (near the bottom of the page)
  4. Close the modal
  5. Focus has returned to the top of the page (should return to previous position)

Issue: Closing content: Closing revealed content must return input focus to the component that revealed it

Why it matters: When a keyboard user dismisses revealed content (such as closing a menu or dialog), they expect focus to return to the trigger control that launched the content. Otherwise, they will have to explore the page content to re-orient themselves.

How to fix:

  1. Good: Ensure that the revealed content appears in the DOM immediately after the trigger component. When the user closes the revealed content, no element will have focus, but pressing Shift+Tab will move focus back to the trigger component.
  2. Better: When the user dismisses revealed content, move focus to the original trigger component. This is the ideal experience when the user cancels a dialog (dismisses it without taking any action).
  3. Best: When the user dismisses revealed content, move focus to the control that makes the most sense given the user's workflow.

W3 reference: https://www.w3.org/WAI/WCAG21/Understanding/focus-order.html

KarlButler1 commented 2 years ago

I've created a PR to resolve this issue here: https://github.com/umbraco/Umbraco-CMS/pull/13093

mikecp commented 2 years ago

Can be closed as per merge of PR 13093

BatJan commented 2 years ago

We need to keep this one open since clicking the "Close" icon (x) does not set the tab focus back on the triggering element. However closing the modal/lightbox using the ESC key works :-)

tiffy74 commented 2 years ago

Moving this to 'in progress' until we can confirm resolved.