diff --git a/console/src/app/modules/input/input.directive.ts b/console/src/app/modules/input/input.directive.ts index ca160b680..a7e2f644f 100644 --- a/console/src/app/modules/input/input.directive.ts +++ b/console/src/app/modules/input/input.directive.ts @@ -363,7 +363,8 @@ export class InputDirective private _dirtyCheckPlaceholder(): void { // If we're hiding the native placeholder, it should also be cleared from the DOM, otherwise // screen readers will read it out twice: once from the label and once from the attribute. - const placeholder = null; + const placeholder = this._getPlaceholder(); + if (placeholder !== this._previousPlaceholder) { const element = this._elementRef.nativeElement; this._previousPlaceholder = placeholder; @@ -371,6 +372,11 @@ export class InputDirective } } + /** Gets the current placeholder of the form field. */ + protected _getPlaceholder(): string | null { + return this.placeholder || null; + } + /** Does some manual dirty checking on the native input `value` property. */ protected _dirtyCheckNativeValue(): void { const newValue = this._elementRef.nativeElement.value;