We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a29ac8b commit 17d92f6Copy full SHA for 17d92f6
textfield/lib/text-field.ts
@@ -506,6 +506,18 @@ export abstract class TextField extends LitElement {
506
super.willUpdate(changedProperties);
507
}
508
509
+ protected override updated() {
510
+ // If a property such as `type` changes and causes the internal <input>
511
+ // value to change without dispatching an event, re-sync it.
512
+ const value = this.getInput().value;
513
+ if (this.value !== value) {
514
+ // Note this is typically inefficient in updated() since it schedules
515
+ // another update. However, it is needed for the <input> to fully render
516
+ // before checking its value.
517
+ this.value = value;
518
+ }
519
520
+
521
protected handleInput(event: InputEvent) {
522
this.dirty = true;
523
this.value = (event.target as HTMLInputElement).value;
0 commit comments