From 29ee1bdccfcce3cfcd19a877e24b09268656ba19 Mon Sep 17 00:00:00 2001 From: zombieFox Date: Thu, 9 Sep 2021 21:51:28 +0100 Subject: [PATCH] fix radio inline label --- src/component/control/radio/index.js | 26 +++++++++---------- .../menuContent/layoutSetting/index.js | 1 + 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/src/component/control/radio/index.js b/src/component/control/radio/index.js index bedcf00b..4c31a224 100644 --- a/src/component/control/radio/index.js +++ b/src/component/control/radio/index.js @@ -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; }; diff --git a/src/component/menuContent/layoutSetting/index.js b/src/component/menuContent/layoutSetting/index.js index 30059ae8..3dbe4e57 100644 --- a/src/component/menuContent/layoutSetting/index.js +++ b/src/component/menuContent/layoutSetting/index.js @@ -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' },