Browse Source

Add __clearAttributes to ComponentView

update-activate
Artur Arseniev 7 months ago
parent
commit
c6081acada
  1. 11
      packages/core/src/dom_components/view/ComponentView.ts

11
packages/core/src/dom_components/view/ComponentView.ts

@ -360,9 +360,7 @@ TComp> {
...(textable && { contenteditable: 'false' }),
};
// Remove all current attributes
each(el.attributes, (attr) => attrs.push(attr.nodeName));
attrs.forEach((attr) => $el.removeAttr(attr));
this.__clearAttributes();
this.updateStyle();
this.updateHighlight();
const attr = {
@ -376,6 +374,13 @@ TComp> {
$el.attr(attr);
}
__clearAttributes() {
const { el, $el } = this;
const attrs: string[] = [];
each(el.attributes, (attr) => attrs.push(attr.nodeName));
attrs.forEach((attr) => $el.removeAttr(attr));
}
/**
* Update component content
* @private

Loading…
Cancel
Save