-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Closed
Labels
P2The issue is important to a large percentage of users, with a workaroundThe issue is important to a large percentage of users, with a workaroundhelp wantedThe team would appreciate a PR from the community to address this issueThe team would appreciate a PR from the community to address this issue
Description
Bug, feature request, or proposal:
Bug
What is the expected behavior?
Clicking a calendar button should interact with the calendar and not the parent form
What is the current behavior?
Clicking a calendar button submits the wrapping form
What are the steps to reproduce?
- Put a mat-calendar inside a form with a submit handler
- Click next or previous
https://angular-material2-issue-zi9txa.stackblitz.io
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
Tested with latest in ng2 (6.0.0-beta.7) and material2 (6.0.0-beta.4), as well as ng5.2.4 and material 5.2.1. I've been using OSX 10.13.3/Chrome but I guarantee that this will happen in any modern browser.
Is there anything else we should know?
By default, the type of a button element in HTML is set to "submit", so when it is clicked it will submit the form regardless of what click handlers get invoked.
Metadata
Metadata
Labels
P2The issue is important to a large percentage of users, with a workaroundThe issue is important to a large percentage of users, with a workaroundhelp wantedThe team would appreciate a PR from the community to address this issueThe team would appreciate a PR from the community to address this issue