This repository was archived by the owner on Sep 5, 2024. It is now read-only.
This repository was archived by the owner on Sep 5, 2024. It is now read-only.
a11y: dialog is always restoring focus. #7963
Closed
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