Update bx-select's layout

This commit is contained in:
redphx
2024-07-15 21:18:51 +07:00
parent 394dc68ece
commit be338f3e34
5 changed files with 47 additions and 15 deletions

View File

@@ -381,7 +381,7 @@ export function setupSettingsUi() {
$control.setAttribute('tabindex', -1);
}
const $label = CE('label', labelAttrs, settingLabel);
const $label = CE<HTMLLabelElement>('label', labelAttrs, settingLabel);
if (settingNote) {
$label.appendChild(CE('b', {}, settingNote));
}
@@ -397,7 +397,10 @@ export function setupSettingsUi() {
} else {
$elm = CE('div', {'class': 'bx-settings-row', 'data-group': 0},
$label,
CE('div', {class: 'bx-setting-control'}, $control),
$control instanceof HTMLInputElement ? CE('label', {
class: 'bx-setting-control',
for: $label.getAttribute('for'),
}, $control) : CE('div', {class: 'bx-setting-control'}, $control),
);
}