We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
appElement
1 parent 9523683 commit 8b8b12cCopy full SHA for 8b8b12c
src/helpers/safeHTMLElement.js
@@ -2,7 +2,18 @@ import ExecutionEnvironment from "exenv";
2
3
const EE = ExecutionEnvironment;
4
5
-const SafeHTMLElement = EE.canUseDOM ? window.HTMLElement : {};
+const NodeTypeElement = 1;
6
+
7
+const IHTMLElement = function(props, propName) {
8
+ const element = props[propName];
9
+ return (
10
+ element.nodeType === NodeTypeElement &&
11
+ element.setAttribute &&
12
+ element.removeAttribute
13
+ );
14
+};
15
16
+const SafeHTMLElement = EE.canUseDOM ? IHTMLElement : {};
17
18
export const SafeHTMLCollection = EE.canUseDOM ? window.HTMLCollection : {};
19
0 commit comments