mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-13 12:26:35 +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}
|
.autocapitalize=${this.autocapitalize}
|
||||||
.type=${this._unmaskedPassword ? "text" : "password"}
|
.type=${this._unmaskedPassword ? "text" : "password"}
|
||||||
.suffix=${html`<div style="width: 24px"></div>`}
|
.suffix=${html`<div style="width: 24px"></div>`}
|
||||||
@input=${this._handleInputChange}
|
@input=${this._handleInputEvent}
|
||||||
@change=${this._reDispatchEvent}
|
@change=${this._handleChangeEvent}
|
||||||
></ha-textfield>
|
></ha-textfield>
|
||||||
<ha-icon-button
|
<ha-icon-button
|
||||||
toggles
|
toggles
|
||||||
@ -153,11 +153,16 @@ export class HaPasswordField extends LitElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@eventOptions({ passive: true })
|
@eventOptions({ passive: true })
|
||||||
private _handleInputChange(ev) {
|
private _handleInputEvent(ev) {
|
||||||
this.value = ev.target.value;
|
this.value = ev.target.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
@eventOptions({ passive: true })
|
@eventOptions({ passive: true })
|
||||||
|
private _handleChangeEvent(ev) {
|
||||||
|
this.value = ev.target.value;
|
||||||
|
this._reDispatchEvent(ev);
|
||||||
|
}
|
||||||
|
|
||||||
private _reDispatchEvent(oldEvent: Event) {
|
private _reDispatchEvent(oldEvent: Event) {
|
||||||
const newEvent = new Event(oldEvent.type, oldEvent);
|
const newEvent = new Event(oldEvent.type, oldEvent);
|
||||||
this.dispatchEvent(newEvent);
|
this.dispatchEvent(newEvent);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user