Skip to content

Commit

Permalink
fix(segmentedcontrol): allow all buttons to be deselected y removing …
Browse files Browse the repository at this point in the history
…a condition in handleActive (#891)
  • Loading branch information
masoudmanson authored Nov 6, 2024
1 parent 58de13c commit 5ef9167
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions packages/components/src/core/SegmentedControl/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,11 @@ const SegmentedControl = (props: SegmentedControlProps) => {
event: React.MouseEvent<HTMLElement>,
newActive: string | null
) => {
if (newActive !== null) {
if (!isControlled) {
setActive(newActive);
}
if (onChangeProp) {
onChangeProp(event, newActive);
}
if (!isControlled) {
setActive(newActive);
}
if (onChangeProp) {
onChangeProp(event, newActive);
}
};

Expand Down

0 comments on commit 5ef9167

Please sign in to comment.