-
-
Notifications
You must be signed in to change notification settings - Fork 177
fix: allow form submission when pressing enter on a checkbox #1895
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: allow form submission when pressing enter on a checkbox #1895
Conversation
🦋 Changeset detectedLatest commit: 70d9594 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
built with Refined Cloudflare Pages Action⚡ Cloudflare Pages Deployment
|
|
Could you not just pass type="submit" to the checkbox? |
|
I think we just don't prevent default when enter is pressed if type="submit" seems like a simpler fix here |
|
Ah but I guess that would still strigger a "click" event on the button thus changing the state, so this solution might be best after all. I do still think we should detect the type prop and only submit if it's type="submit" |
yes exactly, the click event is detected instead. ok I will update the code to reflect that change |
|
wait, don't you think that having the |
You're comparing an |
|
Done, any other suggestion? btw, do you think other components should have the same behaviour? e.g. the radio-group, the switch, etc |
fixes: #1894