From 3a14a0a7609e3a63ab204993158c8fd6460422b3 Mon Sep 17 00:00:00 2001 From: Martin Guillon Date: Fri, 29 Jan 2021 21:19:15 +0100 Subject: [PATCH] perf(core): no need for batchUpdated if no selector (#9121) --- packages/core/ui/styling/style-scope.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/core/ui/styling/style-scope.ts b/packages/core/ui/styling/style-scope.ts index 5d5ba5a7c..f4ef5e6fa 100644 --- a/packages/core/ui/styling/style-scope.ts +++ b/packages/core/ui/styling/style-scope.ts @@ -472,6 +472,9 @@ export class CssState { } const matchingSelectors = this._match.selectors.filter((sel) => (sel.dynamic ? sel.match(view) : true)); + if (!matchingSelectors || matchingSelectors.length === 0) { + return; + } view._batchUpdate(() => { this.stopKeyframeAnimations(); this.setPropertyValues(matchingSelectors);