cornerstone icon indicating copy to clipboard operation
cornerstone copied to clipboard

Allow radio buttons to get deselected not working

Open bichelesi opened this issue 2 years ago • 2 comments

It isn't possible to deselected a radio buttons.

To allow, i try to change :

https://github.com/bigcommerce/cornerstone/blob/53e5b5edde9d1075de9dab95dcb75554a04e8611/assets/js/theme/common/product-details-base.js#L67

to

if ($radio.attr('data-state') === undefined) 

but it isn't perfect because sometime radio not checked.

bichelesi avatar Jan 21 '24 15:01 bichelesi

@bichelesi this is standard behaviour for radio buttons - its required and to deselect one you always need to select other.

yurytut1993 avatar Jan 22 '24 10:01 yurytut1993

@yurytut1993 It’s standard HTML behaviour but there is a custom function to do this.

 /**
     * Allow radio buttons to get deselected
     */


It’s useful when you have disable option. Without this behaviour, you have to refresh if you want to change option,. image

bichelesi avatar Jan 22 '24 12:01 bichelesi