Closed
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.