Skip to content

Commit

Permalink
fix(editor): workaround for editor switch labels not showing
Browse files Browse the repository at this point in the history
  • Loading branch information
MHA committed Jul 20, 2020
1 parent 58251ca commit d52d1c3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
12 changes: 9 additions & 3 deletions src/editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,26 +133,29 @@ export class SelectListCardEditor extends LitElement implements LovelaceCardEdit
.checked=${this._truncate}
.configValue=${'truncate'}
@change=${this._valueChanged}
>${localize('editor.truncate')}</ha-switch
>
</ha-switch>
<span class="switch-label">${localize('editor.show_toggle')}</span>
</div>
<div class="row">
<ha-switch
aria-label=${`Toggle scroll to selected ${this._scroll_to_selected ? 'off' : 'on'}`}
.checked=${this._scroll_to_selected}
.configValue=${'scroll_to_selected'}
@change=${this._valueChanged}
>${localize('editor.scroll_to_selected')}</ha-switch
>
</ha-switch>
<span class="switch-label">${localize('editor.scroll_to_selected')}</span>
</div>
<div class="row">
<ha-switch
aria-label=${`Toggle show toggle ${this._show_toggle ? 'off' : 'on'}`}
.checked=${this._show_toggle}
.configValue=${'show_toggle'}
@change=${this._valueChanged}
>${localize('editor.show_toggle')}</ha-switch
>
</ha-switch>
<span class="switch-label">${localize('editor.show_toggle')}</span>
</div>
</div>
</div>
Expand Down Expand Up @@ -203,6 +206,9 @@ export class SelectListCardEditor extends LitElement implements LovelaceCardEdit
flex: 1;
padding-right: 4px;
}
.switch-label {
margin-left: 10px;
}
`;
}
}
1 change: 0 additions & 1 deletion src/select-list-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ export class SelectListCard extends LitElement implements LovelaceCard {
const dummy = hass;
return {
entity: entity || '',
name: '',
icon: '',
truncate: true,
show_toggle: false,
Expand Down

0 comments on commit d52d1c3

Please # to comment.