Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't use DatePicker within a form as it triggers form to submit #130

Closed
cstrat opened this issue Jul 6, 2021 · 4 comments
Closed

Can't use DatePicker within a form as it triggers form to submit #130

cstrat opened this issue Jul 6, 2021 · 4 comments

Comments

@cstrat
Copy link
Contributor

cstrat commented Jul 6, 2021

Love the DatePicker component - unfortunately it seems to submit any forms that it is part of.

See reproduction here:

https://codesandbox.io/s/mantine-date-picker-in-forms-nvo2f

@rtivital
Copy link
Member

rtivital commented Jul 6, 2021

I forgot the type=button on the input, will fix in 2.0.2

@cstrat
Copy link
Contributor Author

cstrat commented Jul 6, 2021

I didn't get to look under the hood but thats a much simpler issue than I thought it might be - awesome. I was worried there was an embedded form or something in the component.

@rtivital
Copy link
Member

rtivital commented Jul 6, 2021

It's usually always the case in such situations as button element type defaults to submit

@rtivital
Copy link
Member

rtivital commented Jul 6, 2021

Resolved with #135

@rtivital rtivital closed this as completed Jul 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants