This repository was archived by the owner on Sep 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
This repository was archived by the owner on Sep 5, 2024. It is now read-only.
a11y: dialog is always restoring focus. #7963
Copy link
Copy link
Closed
Labels
P0: criticalCritical issues that must be addressed immediately.Critical issues that must be addressed immediately.a11yThis issue is related to accessibilityThis issue is related to accessibilityhas: Pull RequestA PR has been created to address this issueA PR has been created to address this issueui: focus
Milestone
Description
The dialog is currently always restoring the focus when it's closing.
function detachAndClean() {
angular.element($document[0].body).removeClass('md-dialog-is-showing');
element.remove();
if (!options.$destroy) options.origin.focus();
}This is a weird behavior, when clicking for example on a list-item which opens a dialog as an action.
So if the dialog is closing, then the focus will be restored back to the button inside the list-item, which triggered the ngClick action.
This causes the button, to have a focus effect, which shouldn't be. We're only showing the focus effect if there was no mouse click the last 100ms.
In my opinion, we should have different accessibility actions, when the last interaction was from a keyboard / mouse or touch.
We currently have a PR pending, which adds the required functionality. (#7965)
It was an old PR, and I reworked it again.
This PR would allow fixes for:
- The dialog focus restore with a list-item (bug(list): clickable list items do not have a focus state #7960)
- Focus Effect for Switches (md-switch ripple turns on when window gets focus #7837)
- Button Shows Focus when Switching browser tabs
Metadata
Metadata
Assignees
Labels
P0: criticalCritical issues that must be addressed immediately.Critical issues that must be addressed immediately.a11yThis issue is related to accessibilityThis issue is related to accessibilityhas: Pull RequestA PR has been created to address this issueA PR has been created to address this issueui: focus