Skip to content

Commit

Permalink
fix(widgets): replace innerHTML with innerText
Browse files Browse the repository at this point in the history
  • Loading branch information
CamilleFljt committed Feb 14, 2024
1 parent d8a7163 commit 7193f7d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions src/assets/widget/js/widgets.umd.js
Original file line number Diff line number Diff line change
Expand Up @@ -1700,7 +1700,7 @@
}

function polyfillClassList(ele) {
if (!ele || !('innerHTML' in ele)) throw TypeError('Illegal invocation');
if (!ele || !('innerText' in ele)) throw TypeError('Illegal invocation');
ele.detachEvent('onpropertychange', whenPropChanges); // prevent duplicate handler infinite loop

allowTokenListConstruction = 1;
Expand Down Expand Up @@ -7398,7 +7398,7 @@
}

var D = {};
"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function (a) {
"children dangerouslySetInnerHTML defaultValue defaultChecked innerText suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function (a) {
D[a] = new B(a, 0, !1, a, null, !1, !1);
});
[["acceptCharset", "accept-charset"], ["className", "class"], ["htmlFor", "for"], ["httpEquiv", "http-equiv"]].forEach(function (a) {
Expand Down Expand Up @@ -7932,9 +7932,9 @@
});
} : a;
}(function (a, b) {
if (a.namespaceURI !== kb.svg || "innerHTML" in a) a.innerHTML = b;else {
if (a.namespaceURI !== kb.svg || "innerText" in a) a.innerText = b;else {
nb = nb || document.createElement("div");
nb.innerHTML = "<svg>" + b.valueOf().toString() + "</svg>";
nb.innerText = "<svg>" + b.valueOf().toString() + "</svg>";

for (b = nb.firstChild; a.firstChild;) a.removeChild(a.firstChild);

Expand Down Expand Up @@ -12217,7 +12217,7 @@
} else {
g = 9 === e.nodeType ? e : e.ownerDocument;
a === kb.html && (a = lb(c));
a === kb.html ? "script" === c ? (a = g.createElement("div"), a.innerHTML = "<script>\x3c/script>", a = a.removeChild(a.firstChild)) : "string" === typeof d.is ? a = g.createElement(c, {
a === kb.html ? "script" === c ? (a = g.createElement("div"), a.innerText = "<script>\x3c/script>", a = a.removeChild(a.firstChild)) : "string" === typeof d.is ? a = g.createElement(c, {
is: d.is
}) : (a = g.createElement(c), "select" === c && (g = a, d.multiple ? g.multiple = !0 : d.size && (g.size = d.size))) : a = g.createElementNS(a, c);
a[wf] = b;
Expand Down Expand Up @@ -15518,7 +15518,7 @@
function hidesContents(element) {
var zeroSize = element.offsetWidth <= 0 && element.offsetHeight <= 0; // If the node is empty, this is good enough

if (zeroSize && !element.innerHTML) return true;
if (zeroSize && !element.innerText) return true;

try {
// Otherwise we need to check some styles
Expand Down
2 changes: 1 addition & 1 deletion src/assets/widget/js/widgets.umd.js.map

Large diffs are not rendered by default.

0 comments on commit 7193f7d

Please sign in to comment.