Skip to content

Commit 1d74c80

Browse files
Merge branch 'main' into i-frame
2 parents df7f8cd + 46173bf commit 1d74c80

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

projects/components/src/input/input.component.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
1-
import { ChangeDetectionStrategy, Component, EventEmitter, Input, OnChanges, Output } from '@angular/core';
1+
import {
2+
ChangeDetectionStrategy,
3+
ChangeDetectorRef,
4+
Component,
5+
EventEmitter,
6+
Input,
7+
OnChanges,
8+
Output
9+
} from '@angular/core';
210
import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';
311
import { NumberCoercer, TypedSimpleChanges } from '@hypertrace/common';
412
import { InputAppearance } from './input-appearance';
@@ -54,6 +62,8 @@ export class InputComponent<T extends string | number> implements ControlValueAc
5462

5563
public placeholderValue: string = '';
5664

65+
public constructor(private readonly cdr: ChangeDetectorRef) {}
66+
5767
public ngOnChanges(changes: TypedSimpleChanges<this>): void {
5868
if (changes.placeholder) {
5969
this.placeholderValue = this.placeholder ?? '';
@@ -77,6 +87,7 @@ export class InputComponent<T extends string | number> implements ControlValueAc
7787
public writeValue(value?: string): void {
7888
const coercedValue = this.coerceValueIfNeeded(value);
7989
this.value = coercedValue;
90+
this.cdr.markForCheck();
8091
}
8192

8293
public registerOnChange(onChange: (value: T | undefined) => void): void {

0 commit comments

Comments
 (0)