Skip to content
This repository was archived by the owner on Jan 6, 2025. It is now read-only.

Commit a96ef13

Browse files
authored
fix(core): only trigger style updates when value changes (#1246)
1 parent b05d51a commit a96ef13

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/lib/core/base/base2.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ export abstract class BaseDirective2 implements OnChanges, OnDestroy {
2020
/** The most recently used styles for the builder */
2121
protected mru: StyleDefinition = {};
2222
protected destroySubject: Subject<void> = new Subject();
23+
protected currentValue: any;
2324

2425
/** Access to host element's parent DOM node */
2526
protected get parentElement(): HTMLElement | null {
@@ -148,6 +149,9 @@ export abstract class BaseDirective2 implements OnChanges, OnDestroy {
148149
}
149150

150151
protected updateWithValue(input: string) {
151-
this.addStyles(input);
152+
if (this.currentValue !== input) {
153+
this.addStyles(input);
154+
this.currentValue = input;
155+
}
152156
}
153157
}

0 commit comments

Comments
 (0)