Skip to content
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
@devversion

Description

@devversion

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:

cc. @marcysutton @ThomasBurleson @EladBezalel

Metadata

Metadata

Assignees

Labels

P0: criticalCritical issues that must be addressed immediately.a11yThis issue is related to accessibilityhas: Pull RequestA PR has been created to address this issueui: focus

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions