-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Fix keyboard form submission #904
Conversation
Build successful! 🎉 |
Build successful! 🎉 |
Co-authored-by: Daniel Lu <[email protected]>
Build successful! 🎉 |
Build successful! 🎉 |
Build successful! 🎉 |
Build successful! 🎉 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does preventDefault only affect keyboard events? What about clicking the button? We also prevent default there right?
Do you think we should do this sort of detection inside usePress, or should we add an option to stop preventing default that useButton
could pass?
you would think that clicking would have the same issue, but it doesn't seem to be the case, a press still triggers onSubmit as it is in this PR as for detection in here, I don't know, what would it look like outside? |
Build successful! 🎉 |
Build successful! 🎉 |
…lt if requested. I haven't found any others yet.
Build successful! 🎉 |
Build successful! 🎉 |
Build successful! 🎉 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Build successful! 🎉 |
Build successful! 🎉 |
Build successful! 🎉 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Build successful! 🎉 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested locally, confirmed that Space and Enter on a Form's submit button are properly causing onSubmit to be fired. LGTM
Build successful! 🎉 |
@snowystinger thanks for this fix! Can we can merge it in? 🙏 |
Build successful! 🎉 |
Sorry, I tried to get it into this coming release but was unsuccessful. I will try to get it in again in the new year. Thanks for the patience. |
Build successful! 🎉 |
b99f1f3
Build successful! 🎉 |
Closes #963
@LFDanLu found a bug where Forms couldn't be submitted by pressing enter or spacebar on the submit button.
✅ Pull Request Checklist:
📝 Test Instructions:
🧢 Your Project: