Browse Source

fix watching dynamic values in addAttributes

pull/6351/head
mohamedsalem401 1 year ago
parent
commit
d46fa1f85e
  1. 1
      packages/core/src/dom_components/model/Component.ts

1
packages/core/src/dom_components/model/Component.ts

@ -696,6 +696,7 @@ export default class Component extends StyleableModel<ComponentProperties> {
*/ */
addAttributes(attrs: ObjectAny, opts: SetAttrOptions = {}) { addAttributes(attrs: ObjectAny, opts: SetAttrOptions = {}) {
const areStaticAttributes = DynamicValueWatcher.areStaticValues(attrs); const areStaticAttributes = DynamicValueWatcher.areStaticValues(attrs);
this.componentDVListener.removeAttributes(Object.keys(attrs));
const evaluatedAttributes = areStaticAttributes ? attrs : DynamicValueWatcher.getStaticValues(attrs, this.em); const evaluatedAttributes = areStaticAttributes ? attrs : DynamicValueWatcher.getStaticValues(attrs, this.em);
this.componentDVListener.watchAttributes(attrs); this.componentDVListener.watchAttributes(attrs);

Loading…
Cancel
Save