parent
ed888200f9
commit
c97c3f2fc4
|
@ -24,6 +24,8 @@ class HaUsersPickerLight extends LitElement {
|
|||
@property({ attribute: false })
|
||||
public users?: User[];
|
||||
|
||||
@property({ type: Boolean }) public disabled = false;
|
||||
|
||||
protected firstUpdated(changedProps) {
|
||||
super.firstUpdated(changedProps);
|
||||
if (this.users === undefined) {
|
||||
|
@ -57,6 +59,7 @@ class HaUsersPickerLight extends LitElement {
|
|||
this.users,
|
||||
notSelectedUsers
|
||||
)}
|
||||
.disabled=${this.disabled}
|
||||
@value-changed=${this._userChanged}
|
||||
></ha-user-picker>
|
||||
<ha-icon-button
|
||||
|
@ -78,7 +81,7 @@ class HaUsersPickerLight extends LitElement {
|
|||
this.hass!.localize("ui.components.user-picker.add_user")}
|
||||
.hass=${this.hass}
|
||||
.users=${notSelectedUsers}
|
||||
.disabled=${!notSelectedUsers?.length}
|
||||
.disabled=${this.disabled || !notSelectedUsers?.length}
|
||||
@value-changed=${this._addUser}
|
||||
></ha-user-picker>
|
||||
`;
|
||||
|
|
Loading…
Reference in New Issue