Render choose and if action correctly on mobile (#25411)

This commit is contained in:
Bram Kragten 2025-05-10 09:03:53 +02:00 committed by GitHub
parent 42c8d132bf
commit 193caec2df
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 11 additions and 0 deletions

View File

@ -18,6 +18,8 @@ export class HaChooseAction extends LitElement implements ActionElement {
@property({ attribute: false }) public action!: ChooseAction;
@property({ type: Boolean }) public narrow = false;
@state() private _showDefault = false;
public static get defaultConfig(): ChooseAction {
@ -35,6 +37,7 @@ export class HaChooseAction extends LitElement implements ActionElement {
.disabled=${this.disabled}
@value-changed=${this._optionsChanged}
.hass=${this.hass}
.narrow=${this.narrow}
></ha-automation-option>
${this._showDefault || action.default
@ -49,6 +52,7 @@ export class HaChooseAction extends LitElement implements ActionElement {
.disabled=${this.disabled}
@value-changed=${this._defaultChanged}
.hass=${this.hass}
.narrow=${this.narrow}
></ha-automation-action>
`
: html`

View File

@ -18,6 +18,8 @@ export class HaIfAction extends LitElement implements ActionElement {
@property({ attribute: false }) public action!: IfAction;
@property({ type: Boolean }) public narrow = false;
@state() private _showElse = false;
public static get defaultConfig(): IfAction {
@ -41,6 +43,7 @@ export class HaIfAction extends LitElement implements ActionElement {
.disabled=${this.disabled}
@value-changed=${this._ifChanged}
.hass=${this.hass}
.narrow=${this.narrow}
></ha-automation-condition>
<h3>
@ -53,6 +56,7 @@ export class HaIfAction extends LitElement implements ActionElement {
.disabled=${this.disabled}
@value-changed=${this._thenChanged}
.hass=${this.hass}
.narrow=${this.narrow}
></ha-automation-action>
${this._showElse || action.else
? html`
@ -66,6 +70,7 @@ export class HaIfAction extends LitElement implements ActionElement {
.disabled=${this.disabled}
@value-changed=${this._elseChanged}
.hass=${this.hass}
.narrow=${this.narrow}
></ha-automation-action>
`
: html` <div class="link-button-row">

View File

@ -183,6 +183,7 @@ export default class HaAutomationOptionRow extends LitElement {
)}
.disabled=${this.disabled}
.hass=${this.hass}
.narrow=${this.narrow}
@value-changed=${this._conditionChanged}
></ha-automation-condition>
<h4>
@ -194,6 +195,7 @@ export default class HaAutomationOptionRow extends LitElement {
.actions=${ensureArray(this.option.sequence) || []}
.disabled=${this.disabled}
.hass=${this.hass}
.narrow=${this.narrow}
@value-changed=${this._actionChanged}
></ha-automation-action>
</div>