Skip to content
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

[@mantine/core] Allow value reset in SegmentedControl #5689

Merged
merged 1 commit into from Feb 26, 2024

Conversation

gl3nn
Copy link
Contributor

@gl3nn gl3nn commented Jan 31, 2024

Currently it's not possible to deselect/reset the value of the SegmentedControl. You can start out with an empty value, if you take for instance the empty string as value and make sure that in the data property it doesn't map to anything. If however you then select a value, and then change the value state back to the empty string, the SegmentedControl will still visually show your last selected value to be selected (however data-selected=true will no longer be present).

My PR here fixes this behavior and allows you, with a controlled value, to make the component unselected / without anything selected.

@gl3nn gl3nn changed the title Allow value reset in SegmentedControl [@mantine/core] Allow value reset in SegmentedControl Feb 1, 2024
@rtivital rtivital merged commit 1215f6d into mantinedev:master Feb 26, 2024
1 check passed
@rtivital
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants