Skip to content

Commit 7c0e430

Browse files
committed
gw-limit-columns-in-survey-field-to-single-selection.js: Fixed issue with snippet not working with GF2.5 theme.
1 parent b2580db commit 7c0e430

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

gravity-forms/gw-limit-columns-in-survey-field-to-single-selection.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,16 @@ $( document ).on( 'change', `#field_${GFFORMID}_${fieldId} input[type="radio"]`,
3333
const $radiosInColumn = $table.find( `input[type="radio"][aria-labelledby*="${columnId}"]` );
3434

3535
// Deselect all other radio buttons in the same column.
36-
$radiosInColumn.not( $selectedRadio ).prop( 'checked', false );
36+
$radiosInColumn.not($selectedRadio).each(function () {
37+
let $radio = $(this);
38+
let $parentTd = $radio.closest('td');
39+
40+
$radio.prop('checked', false);
41+
42+
// if gsurvey-likert-selected class is added to the parent td, remove it (GF 2.5 Theme).
43+
if ( $parentTd.length && $parentTd.hasClass( 'gsurvey-likert-selected' ) ) {
44+
$parentTd.removeClass( 'gsurvey-likert-selected' );
45+
}
46+
});
3747
}
3848
});

0 commit comments

Comments
 (0)