Skip to content
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

feat(useSelect): focus toggle on label click #1561

Merged
merged 3 commits into from
Dec 29, 2023

Conversation

silviuaavram
Copy link
Collaborator

@silviuaavram silviuaavram commented Dec 29, 2023

What:
Focus the toggle element when the <label> is clicked, for useSelect.

Why:
Closes #1557.
Native <select> works the same way with a <label>
ARIA also is on board: w3c/aria-practices#2859

How:
Add a custom onClick handler to useSelect getLabelProps that focuses the toggle element.

Checklist:

  • Documentation
  • Tests
  • TypeScript Types
  • Flow Types
  • Ready to be merged

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (4edfc30) 100.00% compared to head (9a06b40) 100.00%.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff            @@
##            master     #1561   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           18        18           
  Lines         1735      1738    +3     
  Branches       521       522    +1     
=========================================
+ Hits          1735      1738    +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@silviuaavram silviuaavram merged commit 53dd723 into master Dec 29, 2023
2 checks passed
@silviuaavram silviuaavram deleted the feat/focus-toggle-on-label-click branch December 29, 2023 10:31
Copy link

🎉 This PR is included in version 8.3.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Select element doesn't receive focus when the label is clicked.
2 participants