Add type="button" to controls in mat-calendar #10514
Labels
help wanted
The team would appreciate a PR from the community to address this issue
P2
The issue is important to a large percentage of users, with a workaround
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?
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.
The text was updated successfully, but these errors were encountered: