File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -53,12 +53,15 @@ class Radios extends FormElementGroup {
5353 _onFormElementClick ( formElement , UIElement ) {
5454 // radio buttons should only trigger a change if the clicked item isnt already selected
5555 if ( this . _lastRadioClicked !== formElement ) {
56- this . triggerAll ( function ( formElement , UIElement ) {
57- UIElement . classList . remove ( this . options . selectedClass ) ;
58- formElement . checked = false ;
56+ this . triggerAll ( function ( formEl , UIEl ) {
57+ if ( formEl !== formElement ) {
58+ UIEl . classList . remove ( this . options . selectedClass ) ;
59+ formEl . checked = false ;
60+ } else {
61+ UIEl . classList . add ( this . options . selectedClass ) ;
62+ formEl . checked = true ;
63+ }
5964 } . bind ( this ) ) ;
60- formElement . checked = true ;
61- UIElement . classList . add ( this . options . selectedClass ) ;
6265 this . triggerChange ( formElement , UIElement ) ;
6366 this . _lastRadioClicked = formElement ;
6467 }
You can’t perform that action at this time.
0 commit comments