-
-
Notifications
You must be signed in to change notification settings - Fork 298
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
Prevent event default when pressing enter with open AutoComplete #1439
Prevent event default when pressing enter with open AutoComplete #1439
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
6dcf76c
to
abd97a1
Compare
Hey @carlgieringer, sorry for the late response. I hadn't planned on supporting multiple versions of
I'll use these branches for bugfixes from the community like this one. I've also updated this PR to go into |
Great thanks! I think the issue applies to all versions v2–5. BTW: I had a question in Slack about using TextArea with AutoCompletes. I'm happy to write up an issue discussing the feature request, but I didn't want to spend a lot of time on a PR if it wasn't something you were interested in merging. |
Sorry for the delay. I responded in Slack as well, but here's a followup:
|
This bugfix has been applied and published as:
|
Fixes #194.
Note this commit is based on v2.9.1 because that is where I wanted to apply the fix. Please let me know the preferred approach to submitting fixes to multiple versions.
Codesandbox for reproducing the issue: https://codesandbox.io/s/react-md-autocomplete-submits-form-4hstxo?file=/src/App.tsx
I looked into adding a test, and the following passes, but it doesn't fail before the change, presumably because the fake DOM doesn't properly implement the submit event behavior (https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement/submit_event).