Skip to content

Commit 22872d2

Browse files
committed
fix: disabled works on base fields
1 parent 1982141 commit 22872d2

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/js/base.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,12 @@ chrome.options.addOption = (key, value, save, option) => {
7070
h('img.preview-image', { src: 'previews/' + key + '.' + option.preview }));
7171
}
7272

73+
if (option.disabled) {
74+
$option.querySelectorAll('input, select, textarea').forEach(($f) => {
75+
$f.setAttribute('disabled', true);
76+
});
77+
}
78+
7379
return $option;
7480
};
7581

@@ -598,11 +604,5 @@ chrome.options.addField = (value, save, option) => {
598604
if (option.desc) {
599605
$field.setAttribute('data-title', option.desc);
600606
}
601-
if (option.disabled) {
602-
$field.setAttribute('disabled', true);
603-
$field.querySelectorAll(':scope, input, select, textarea').forEach(($f) => {
604-
$f.setAttribute('disabled', true);
605-
});
606-
}
607607
return $field;
608608
};

0 commit comments

Comments
 (0)