Skip to content

Commit

Permalink
Increased scope of enableAndClear binding #250
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisala committed May 21, 2024
1 parent c0a7136 commit 926ef2d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion grails-app/assets/javascripts/forms-knockout-bindings.js
Original file line number Diff line number Diff line change
Expand Up @@ -1051,11 +1051,16 @@
element.removeAttribute("disabled");
else if ((!value) && (!element.disabled)) {
element.disabled = true;
var possibleValueBindings = ['value', 'datepicker'];
var possibleValueBindings = ['value', 'datepicker', 'selectedOptions', 'multiSelect2', 'speciesSelect'];
for (var i=0; i<possibleValueBindings.length; i++) {
var value = allBindings.get(possibleValueBindings[i]);
// Special case - the multiselect2 binding includes the value binding as an options attribute.
if (possibleValueBindings[i] == 'multiSelect2' && value) {
value = value.value;
}
if (ko.isObservable(value)) {
value(undefined);
break;
}
}
}
Expand Down

0 comments on commit 926ef2d

Please sign in to comment.