-
Notifications
You must be signed in to change notification settings - Fork 646
Make SegmentedControl uncontrolled by default #2189
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
Conversation
🦋 Changeset detectedLatest commit: c50952d The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
size-limit report 📦
|
siddharthkp
left a comment
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.
This feels really nice to use!! ✨
A few questions about the API here:
-
When the component can change the selected button by itself (uncontrolled), should the prop
selectedbe calleddefaultSelectedinstead? (like value and defaultValue for input) -
Do we have a recommended way of firing actions?
onChangeon the parent vsonClickon the buttons? We should reflect the preferred approach in the examples. -
Depending on the answer for 1 + 2, should we have both
selectedanddefaultSelectedsimilar tovalue+defaultValuewherevalueis the controlled version that needs to be managed viaonChange
Meant it to be a comment not changes requested
Yup, we should add
Yes, we should have |
…rol-default-uncontrolled
…m:primer/react into mp/segmented-control-default-uncontrolled
…rol-default-uncontrolled
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.
Testing on local machine, looking good!
quick question: I don't see keyboard navigation behavior from #2220 in this pull request. 🤔 I hope that's okay?
|
@siddharthkp - that doesn't seem right... 🤔 I'll investigate |
|
@siddharthkp - I'm seeing that behavior in the preview deployment |
The SegmentedControl can now be functional without handling state externally.
Merge checklist
Take a look at the What we look for in reviews section of the contributing guidelines for more information on how we review PRs.