Skip to content

Using MatDialogClose breaks default form submit functionality #16909

@flauc

Description

@flauc

Reproduction

StackBlitz: https://stackblitz.com/edit/components-issue-bde981

Steps to reproduce:

  1. Click on the Doesn't Work button to open the dialog
  2. Hit enter

Expected Behavior

In the working example hitting enter submits the form and in this case, closes the dialog. I wouldn't expect that adding
the MatDialogClose directive in place of the click method would change that.

Actual Behavior

Adding MatDialogClose prevents the form from being submitted when hitting enter and not having the button focused.

Environment

  • Angular: 8.0.0
  • CDK/Material: 8.0.0
  • Browser(s): Chrome 76.0
  • Operating System (e.g. Windows, macOS, Ubuntu): Windows

Metadata

Metadata

Assignees

No one assigned

    Labels

    P5The team acknowledges the request but does not plan to address it, it remains open for discussionhelp wantedThe team would appreciate a PR from the community to address this issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions