-
Notifications
You must be signed in to change notification settings - Fork 932
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
Pressing [ENTER] on any input inside <form> element will toggle Downshift #315
Comments
@philipyoungg, It's not Downshift fault 🤨 |
Pressing [ENTER] on any input element calls 'submit' event on form; If Button[type="submit"(by default)] is present in the form - before 'submit' event it will call 'click' event on this button. |
Whoa didn’t know that before submit—form will click the button with type=submit. Thanks @NoTruth! |
Closing as this is not relevant anymore 😁 |
My co-worker has this same problem. Maybe we should explicitly return the type as button from getButtonProps unless it's overridden. I don't think anyone would want the button to submit the form. |
@kentcdodds agreed. |
Will it be appropriate to create a brunch with upcoming Button changes? |
I don't think that's a common enough use case to make that the default. More common to want to focus the input I think... Who wants to make a PR to add |
Actually, this is a great first-timers-only issue... So I'm going to prepare it later today and only allow first-time OSS contributors to submit a PR for it :) |
🆕🐥☝ First Timers Only 🤔 What you will need to know 📋 Step by Step
🤔❓ Questions? Comment here :) |
Hi, I would like to claim this issue please. |
Congratulations @xutopia! |
* add type button to the return object getButtonProps * added myself to the contributor list Closes downshift-js#315
downshift
version: 1.16.1npm
(oryarn
) version: npm 5.5.1Relevant code or config
What you did: Pressing [ENTER] on any input inside
elementWhat happened: It will toggle Downshift content
What do I expect: It won't toggle the Downshift component when pressing [ENTER] inside form element.
Reproduction repository: https://codesandbox.io/s/pwn92r9plx
Suggested solution: I haven't checked on the "why" yet. Adding here first so I won't forget it. :)
The text was updated successfully, but these errors were encountered: