Skip to content

Commit 05ac9ea

Browse files
committed
fix: prevent property change event while batch update or onLoaded
1 parent e89d5cf commit 05ac9ea

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

  • packages/core/ui/core/properties

packages/core/ui/core/properties/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ function getPropertySetter<T extends ViewBase, U>(property: Property<T, U>) {
273273
}
274274
}
275275

276-
if (this.hasListeners(eventName)) {
276+
if (!this._suspendNativeUpdatesCount && this.hasListeners(eventName)) {
277277
this.notify<PropertyChangeData>({
278278
object: this,
279279
eventName,
@@ -567,7 +567,7 @@ function setCssFunc<T extends Style, U>(property: CssProperty<T, U>, valueSource
567567
}
568568
}
569569

570-
if (this.hasListeners(eventName)) {
570+
if (!view._suspendNativeUpdatesCount && this.hasListeners(eventName)) {
571571
this.notify<PropertyChangeData>({
572572
object: this,
573573
eventName,
@@ -821,7 +821,7 @@ export class CssAnimationProperty<T extends Style, U> implements CssAnimationPro
821821
}
822822
}
823823
const eventName = property.eventName;
824-
if (computedValueChanged && this.hasListeners(eventName)) {
824+
if (computedValueChanged && !view._suspendNativeUpdatesCount && this.hasListeners(eventName)) {
825825
this.notify<PropertyChangeData>({
826826
object: this,
827827
eventName,
@@ -981,7 +981,7 @@ function setCssInheritedFunc<T extends Style, U>(property: InheritedCssProperty<
981981
}
982982
}
983983

984-
if (this.hasListeners(eventName)) {
984+
if (!view._suspendNativeUpdatesCount && this.hasListeners(eventName)) {
985985
this.notify<PropertyChangeData>({
986986
object: this,
987987
eventName,

0 commit comments

Comments
 (0)