fix radio inline label

This commit is contained in:
zombieFox 2021-09-09 21:51:28 +01:00
parent 9801fdb733
commit 29ee1bdccf
2 changed files with 13 additions and 14 deletions

View File

@ -125,14 +125,8 @@ export const Control_radio = function({
const wrap = form.wrap();
if (label) {
wrap.appendChild(
form.wrap({
children: [
this.label
]
})
);
if (this.label) {
wrap.appendChild(form.wrap({ children: [this.label] }));
};
this.radioSet.forEach((item, i) => {
@ -167,15 +161,13 @@ export const Control_radio = function({
this.inline = () => {
const formWrap = form.wrap();
const formInline = form.inline({
const inline = form.inline({
gap: 'large',
wrap: true
});
this.radioSet.forEach((item, i) => {
formInline.appendChild(
inline.appendChild(
form.wrap({
children: [
item.radio,
@ -185,9 +177,15 @@ export const Control_radio = function({
);
});
formWrap.appendChild(formInline);
const wrap = form.wrap();
return formWrap;
if (this.label) {
wrap.appendChild(form.wrap({ children: [this.label] }));
};
wrap.appendChild(form.wrap({ children: [inline] }));
return wrap;
};

View File

@ -447,6 +447,7 @@ layoutSetting.page = (parent) => {
layoutSetting.control.page.scrollbar = new Control_radio({
object: state.get.current(),
label: 'Scrollbar',
radioGroup: [
{ id: 'layout-scrollbar-auto', labelText: 'Auto', value: 'auto' },
{ id: 'layout-scrollbar-thin', labelText: 'Thin', value: 'thin' },