How are segmented control components reset? Setting the value = null or '' effectively clears the selection, but whatever value was previously set is not 'selectable' again until an alternate value is selected.
Here's a pen reproducing the issue - https://codepen.io/derekwmiller/pen/bNdxKEm
Select a value -> click the reset icon / button -> try to select the same value -> cannot select it
Solved! Go to Solution.
The calcite doc for Segmented Control notes that it has functionality similar to a Radio Button. If you take a look at the Radio Button doc it notes that for interactions where a choice is optional consider a Checkbox. The key difference between a checkbox and radio button is that radios must always have something active.
So perhaps look at using checkboxes for your scenario?
The calcite doc for Segmented Control notes that it has functionality similar to a Radio Button. If you take a look at the Radio Button doc it notes that for interactions where a choice is optional consider a Checkbox. The key difference between a checkbox and radio button is that radios must always have something active.
So perhaps look at using checkboxes for your scenario?
Thanks for the info @KellyHutchins. That makes sense. Checkboxes are less than ideal in this scenario -- image below.
I put together a work-around with a disabled & hidden calcite-segmented-control-item. The value of the segmented control is set to the hidden item on reset.
Updated pen - https://codepen.io/derekwmiller/pen/bNdxKEm