Disable reorder for readonly automation and disabled block (#19592)

This commit is contained in:
Paul Bottein 2024-01-31 17:48:22 +01:00 committed by GitHub
parent 62bb9b1a87
commit 601a165b2a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 8 additions and 8 deletions

View File

@ -77,7 +77,7 @@ export default class HaAutomationAction extends LitElement {
return html`
<ha-sortable
handle-selector=".handle"
.disabled=${!this._showReorder}
.disabled=${!this._showReorder || this.disabled}
@item-moved=${this._actionMoved}
group="actions"
.path=${this.path}
@ -101,7 +101,7 @@ export default class HaAutomationAction extends LitElement {
@value-changed=${this._actionChanged}
.hass=${this.hass}
>
${this._showReorder
${this._showReorder && !this.disabled
? html`
<div class="handle" slot="icons">
<ha-svg-icon .path=${mdiDrag}></ha-svg-icon>

View File

@ -122,7 +122,7 @@ export class HaChooseAction extends LitElement implements ActionElement {
return html`
<ha-sortable
handle-selector=".handle"
.disabled=${!this._showReorder}
.disabled=${!this._showReorder || this.disabled}
group="choose-options"
.path=${[...(this.path ?? []), "choose"]}
>
@ -148,7 +148,7 @@ export class HaChooseAction extends LitElement implements ActionElement {
? ""
: this._getDescription(option))}
</h3>
${this._showReorder
${this._showReorder && !this.disabled
? html`
<div class="handle" slot="icons">
<ha-svg-icon .path=${mdiDrag}></ha-svg-icon>

View File

@ -117,7 +117,7 @@ export default class HaAutomationCondition extends LitElement {
return html`
<ha-sortable
handle-selector=".handle"
.disabled=${!this._showReorder}
.disabled=${!this._showReorder || this.disabled}
@item-moved=${this._conditionMoved}
group="conditions"
.path=${this.path}
@ -141,7 +141,7 @@ export default class HaAutomationCondition extends LitElement {
@value-changed=${this._conditionChanged}
.hass=${this.hass}
>
${this._showReorder
${this._showReorder && !this.disabled
? html`
<div class="handle" slot="icons">
<ha-svg-icon .path=${mdiDrag}></ha-svg-icon>

View File

@ -74,7 +74,7 @@ export default class HaAutomationTrigger extends LitElement {
return html`
<ha-sortable
handle-selector=".handle"
.disabled=${!this._showReorder}
.disabled=${!this._showReorder || this.disabled}
@item-moved=${this._triggerMoved}
group="triggers"
.path=${this.path}
@ -97,7 +97,7 @@ export default class HaAutomationTrigger extends LitElement {
.hass=${this.hass}
.disabled=${this.disabled}
>
${this._showReorder
${this._showReorder && !this.disabled
? html`
<div class="handle" slot="icons">
<ha-svg-icon .path=${mdiDrag}></ha-svg-icon>