@mintjamsinc/ichigojs 0.1.84 → 0.1.85

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7781,13 +7781,20 @@ class VBindDirective {
7781
7781
  }
7782
7782
  /**
7783
7783
  * Updates a regular attribute.
7784
+ * An attribute that already holds the value is left alone: setting `src` on
7785
+ * an <iframe>, even to the same URL, loads its page again.
7784
7786
  */
7785
7787
  #updateAttribute(element, name, value) {
7786
7788
  if (value == null || value === false) {
7787
- element.removeAttribute(name);
7789
+ if (element.hasAttribute(name)) {
7790
+ element.removeAttribute(name);
7791
+ }
7788
7792
  }
7789
7793
  else {
7790
- element.setAttribute(name, String(value));
7794
+ const text = String(value);
7795
+ if (element.getAttribute(name) !== text) {
7796
+ element.setAttribute(name, text);
7797
+ }
7791
7798
  }
7792
7799
  }
7793
7800
  }
@@ -12054,6 +12061,11 @@ class VHtmlDirective {
12054
12061
  * The expression evaluator for this directive.
12055
12062
  */
12056
12063
  #evaluator;
12064
+ /**
12065
+ * The HTML last set on the element. The same HTML is not set again: that
12066
+ * would replace the elements inside, and load their frames and images again.
12067
+ */
12068
+ #html;
12057
12069
  /**
12058
12070
  * @param context The context for parsing the directive.
12059
12071
  */
@@ -12104,10 +12116,14 @@ class VHtmlDirective {
12104
12116
  get dependentIdentifiers() {
12105
12117
  return identifiers;
12106
12118
  },
12107
- applyToDOM() {
12119
+ applyToDOM: () => {
12108
12120
  const element = vNode.node;
12109
- const htmlContent = evaluator.evaluate();
12110
- element.innerHTML = htmlContent ?? '';
12121
+ const htmlContent = evaluator.evaluate() ?? '';
12122
+ if (htmlContent === this.#html) {
12123
+ return;
12124
+ }
12125
+ this.#html = htmlContent;
12126
+ element.innerHTML = htmlContent;
12111
12127
  }
12112
12128
  };
12113
12129
  return updater;