Skip to content

Closing Dialog using escape only works after initial open w/ button focused #3009

Closed
@rosslavery

Description

@rosslavery

Bug, feature request, or proposal:

Bug

What is the expected behavior?

Dialog should close when escape is pressed, regardless of what is in focus.

What is the current behavior?

If the user interacts with the dialog in any way (causing the initial focus to be lost), pressing escape no longer closes the dialog.

What are the steps to reproduce?

Providing a Plunker (or similar) is the best way to get the team to see your issue.
See: https://material.angular.io/components/component/dialog

What is the use-case or motivation for changing an existing behavior?

A user should be able to press escape to close the dialog at any time.

Which versions of Angular, Material, OS, browsers are affected?

Seemingly all

Is there anything else we should know?

No

Metadata

Metadata

Assignees

Labels

AccessibilityThis issue is related to accessibility (a11y)P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions