diff --git a/packages/controls/css/widgets-base.css b/packages/controls/css/widgets-base.css index 0ee115b192..6a16589ddc 100644 --- a/packages/controls/css/widgets-base.css +++ b/packages/controls/css/widgets-base.css @@ -981,7 +981,6 @@ flex-direction: column; } - /* */ .widget-radio-box-horizontal, /* */ .jupyter-widget-radio-box-horizontal { @@ -998,7 +997,7 @@ .widget-radio-box-horizontal label, .jupyter-widget-radio-box-horizontal label { - margin: 0 calc(var(--jp-widgets-input-padding) * 2) 0 0; + margin: 0 calc(var(--jp-widgets-input-padding) * 2) 0 0; } /* */ diff --git a/packages/controls/src/widget_selection.ts b/packages/controls/src/widget_selection.ts index 11e7d22d1a..7986383d79 100644 --- a/packages/controls/src/widget_selection.ts +++ b/packages/controls/src/widget_selection.ts @@ -288,7 +288,7 @@ export class RadioButtonsModel extends SelectionModel { tooltips: [], icons: [], button_style: '', - orientation:'vertical', + orientation: 'vertical', }; } } @@ -306,24 +306,24 @@ export class RadioButtonsView extends DescriptionView { this.el.appendChild(this.container); this.container.classList.add('widget-radio-box'); - this.update(); + this.update(); } /** * Update the contents of this view * - * Called when the model is changed. The model may have been - * changed by another view or by a state update from the back-end. + * Called when the model is changed. The model may have been + * changed by another view or by a state update from the back-end. */ - update(options?: any): void { - if (this.model.get('orientation') === 'vertical') { - this.container.classList.remove('widget-radio-box-horizontal'); - this.container.classList.add('widget-radio-box-vertical'); - } else { - this.container.classList.remove('widget-radio-box-vertical'); - this.container.classList.add('widget-radio-box-horizontal'); - } - const items: string[] = this.model.get('_options_labels'); + update(options?: any): void { + if (this.model.get('orientation') === 'vertical') { + this.container.classList.remove('widget-radio-box-horizontal'); + this.container.classList.add('widget-radio-box-vertical'); + } else { + this.container.classList.remove('widget-radio-box-vertical'); + this.container.classList.add('widget-radio-box-horizontal'); + } + const items: string[] = this.model.get('_options_labels'); const radios = Array.from( this.container.querySelectorAll('input[type="radio"]') ).map((x) => x.value);