-
Notifications
You must be signed in to change notification settings - Fork 5
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(SegmentedControls): allow for item in list to be disabled #1676
Conversation
✅ Deploy Preview for beta-fondue-components ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
|
✅ Deploy Preview for beta-fondue-components ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for fondue-components ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
const nextIndex = index + 1; | ||
radioGroupState.setSelectedValue(items[nextIndex].id); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Goes out of bounds in case of the last item being disabled
, also a disabled item should be able to be selected by default which makes the change in this function not necessary 🤔
What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had a look at it and it is very weird when the default item is not clickable. The UX is super weird.
I fixed the function to select the item to the left when the last one is default and disabled and to collapse the "cursor/hightlight" when all are disabled
Lead time: 82 days, 23 hours, 53 minutes, 14 seconds (1991.89 total hours) from first commit to close.
|
ClickUp Report
Report: Request to
disable
single items in a group ofitems
Solution:
disabled
prop to theitem
type.map
of theitem
component to referenceitem.disabled || disabled
(default to the group disabled prop)selectedIndex
method to by-pass the item if it isdisabled
(this is the key index that sets theactiveBorder
motion div)fieldset
and update the styles accordingly. The is required to allow the border to be the properz-index
else the disabledbackground
will overlap the left border edge. Added bonus is it is much more responsive to the correct sizing.