Skip to content

Conversation

@RobinMalfait
Copy link
Member

@RobinMalfait RobinMalfait commented Feb 2, 2024

This PR fixes an issue where pressing Enter on a <Checkbox /> component didn't attempt to submit the form. This PR solves that.

The Checkbox component is a span to make it stylable which means that it doesn't have the native capabilities to submit a form (we do render a hidden input field for exposing the data to the parent form but it doesn't retrieve any events directly).

This now implements the same logic as the <Switch /> component where it attempts to submit the form.

Fixes: #2958

@vercel
Copy link

vercel bot commented Feb 2, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
headlessui-react ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 2, 2024 2:47pm
headlessui-vue ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 2, 2024 2:47pm

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

Successfully merging this pull request may close these issues.

[a11y]: Checkbox does not submit form on enter

2 participants