mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-13 04:16:34 +00:00
Update value of password field on change event (#22706)
This commit is contained in:
parent
1e73cebda6
commit
786b9ee8d6
@ -117,8 +117,8 @@ export class HaPasswordField extends LitElement {
|
||||
.autocapitalize=${this.autocapitalize}
|
||||
.type=${this._unmaskedPassword ? "text" : "password"}
|
||||
.suffix=${html`<div style="width: 24px"></div>`}
|
||||
@input=${this._handleInputChange}
|
||||
@change=${this._reDispatchEvent}
|
||||
@input=${this._handleInputEvent}
|
||||
@change=${this._handleChangeEvent}
|
||||
></ha-textfield>
|
||||
<ha-icon-button
|
||||
toggles
|
||||
@ -153,11 +153,16 @@ export class HaPasswordField extends LitElement {
|
||||
}
|
||||
|
||||
@eventOptions({ passive: true })
|
||||
private _handleInputChange(ev) {
|
||||
private _handleInputEvent(ev) {
|
||||
this.value = ev.target.value;
|
||||
}
|
||||
|
||||
@eventOptions({ passive: true })
|
||||
private _handleChangeEvent(ev) {
|
||||
this.value = ev.target.value;
|
||||
this._reDispatchEvent(ev);
|
||||
}
|
||||
|
||||
private _reDispatchEvent(oldEvent: Event) {
|
||||
const newEvent = new Event(oldEvent.type, oldEvent);
|
||||
this.dispatchEvent(newEvent);
|
||||
|
Loading…
x
Reference in New Issue
Block a user