-
-
Notifications
You must be signed in to change notification settings - Fork 421
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(dropdownitems): add DropdownItemCheckbox and DropdownItemRadio #1095
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@ChrisCoastal looks promising. Could you please rebase it with master and also add an example to the documentation? Thanks! :) |
@ChrisCoastal gently ping. :) |
2cdf4ae
to
469a1e9
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1095 +/- ##
==========================================
- Coverage 99.54% 93.75% -5.80%
==========================================
Files 163 215 +52
Lines 6621 9274 +2653
Branches 401 507 +106
==========================================
+ Hits 6591 8695 +2104
- Misses 30 579 +549 ☔ View full report in Codecov by Sentry. |
469a1e9
to
51cc4b2
Compare
Thanks for the gentle bump @rluders. I've done the rebase and updated the docs. Please let me know what you think and if I can make any further changes. 🙃🙏 |
I'm not a fan of this idea, personally. I think the best direction we could take here is to revert Thoughts on this? |
@tulup-conner I agree with you. I think that it is maybe best not to implement the Dropdown.Checkbox and Dropdown.Radio in the React lib at all. As long as Floating UI is being used (for Typeahead and Focus Trapping within the Dropdown) the element within each Honestly, as long as Floating UI is being used as it is now, my feeling would be that the I think this would also address what was actually at the heart of the issue that started this: devs trying to put Whether or not that kind of implementation is consistent with the API you want for the lib (passing props rather than children), I'm not sure. |
re #916 and #941
This commit follows from the conversation in #941 and #916 - adding functionality to the Dropdown component to include Dropdown.ItemRadio and Dropdown.ItemCheckbox.
It also fixes a bug in DropdownItem.tsx that will only ever set the selectIndex to
null
. Currently, however, selectedIndex isn't used anywhere, so possibly it should just be removed (or maybe there is conditional styling that should be added to reflect its state)?Related to #916 and #941
There are no breaking API changes. Both FloatingUI Typeahead functionality and Arrow Navigation will work for the new item components (tabbing through the dropdown also works) in accordance with WCAG.
Additional considerations:
DropdownItem
(and the FloatingUI Typeahead catching all the input keystrokes). The component could possibly be updated to not accept children or offer a warning in development.