-
Notifications
You must be signed in to change notification settings - Fork 2
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
Improve SelectNext props API #1288
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1288 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 62 62
Lines 900 904 +4
Branches 345 348 +3
=========================================
+ Hits 900 904 +4
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
24aac85
to
6c93459
Compare
Hmm, I think it is possibly unclear here which element the props will be applied to, since the select control has at least three major elements:
The general convention in the package is that forwarded props get applied to the outermost element, although I do see at least one exception ( We could also defer this decision by only supporting setting an |
If we check the In most of the components, the outermost and primary elements are the same, but there are exceptions, like the I think With this in mind I think it makes more sense (and it is what I would personally expect) that the main props API we expose allows non-specific props to be forwarded to the button. However, I think it would make sense to have I'm also open to start just with the |
6c93459
to
839f9ee
Compare
@robertknight in order to move things forward I have reverted the Let's continue the other discussion when/if needed. |
839f9ee
to
a8cc3d5
Compare
Part of #1285
This PR addresses some of the issues highlighted while using it in a real use-case:
ArrowDown
on the select toggle, which is used to open the dropdown, and otherwise scrolls the page down a bit.buttonId
to be provided, which is passed as the toggle buttonid
if provided. We keep generating a fallback value withuseId
.label
and replace it withbuttonContent
, aslabel
was suggesting a different purpose than the one it is actually used for.