Skip to content

Commit 0c9b5f8

Browse files
author
Oleksii Korshenko
authored
MAGETWO-70181: Allow option disabling for optgroup binding #10031
2 parents 5d6abe4 + dfdf281 commit 0c9b5f8

File tree

1 file changed

+5
-0
lines changed
  • app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings

1 file changed

+5
-0
lines changed

app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/optgroup.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,11 +297,16 @@ define([
297297
ko.utils.arrayForEach(options, function (option) {
298298
var value = applyToObject(option, optionsValue, option),
299299
label = applyToObject(option, optionsText, value) || '',
300+
disabled = applyToObject(option, 'disabled', false) || false,
300301
obj = {},
301302
space = '\u2007\u2007\u2007';
302303

303304
obj[optionTitle] = applyToObject(option, optionsText + 'title', value);
304305

306+
if (disabled) {
307+
obj.disabled = disabled;
308+
}
309+
305310
label = label.replace(nbspRe, '').trim();
306311

307312
if (Array.isArray(value)) {

0 commit comments

Comments
 (0)