Forward change event in password field (#22377)

This commit is contained in:
Bram Kragten 2024-10-15 12:07:12 +02:00 committed by GitHub
parent fca97cd734
commit e31af5d31b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -118,6 +118,7 @@ export class HaPasswordField extends LitElement {
.type=${this._unmaskedPassword ? "text" : "password"}
.suffix=${html`<div style="width: 24px"></div>`}
@input=${this._handleInputChange}
@change=${this._reDispatchEvent}
></ha-textfield>
<ha-icon-button
toggles
@ -156,6 +157,12 @@ export class HaPasswordField extends LitElement {
this.value = ev.target.value;
}
@eventOptions({ passive: true })
private _reDispatchEvent(oldEvent: Event) {
const newEvent = new Event(oldEvent.type, oldEvent);
this.dispatchEvent(newEvent);
}
static styles = css`
:host {
display: block;