Skip to content

Commit 09dfd10

Browse files
committed
ie fix
1 parent a86a96f commit 09dfd10

6 files changed

Lines changed: 33 additions & 29 deletions

File tree

dist/htmx.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -368,13 +368,14 @@ return (function () {
368368
return elemTop < window.innerHeight && elemBottom >= 0;
369369
}
370370

371-
function bodyContains(elt) {
372-
if (elt.getRootNode() instanceof ShadowRoot) {
373-
return getDocument().body.contains(elt.getRootNode().host);
374-
} else {
375-
return getDocument().body.contains(elt);
376-
}
377-
}
371+
function bodyContains(elt) {
372+
// IE Fix
373+
if (elt.getRootNode && elt.getRootNode() instanceof ShadowRoot) {
374+
return getDocument().body.contains(elt.getRootNode().host);
375+
} else {
376+
return getDocument().body.contains(elt);
377+
}
378+
}
378379

379380
function splitOnWhitespace(trigger) {
380381
return trigger.trim().split(/\s+/);

dist/htmx.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/htmx.min.js.gz

4 Bytes
Binary file not shown.

src/htmx.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -368,13 +368,14 @@ return (function () {
368368
return elemTop < window.innerHeight && elemBottom >= 0;
369369
}
370370

371-
function bodyContains(elt) {
372-
if (elt.getRootNode() instanceof ShadowRoot) {
373-
return getDocument().body.contains(elt.getRootNode().host);
374-
} else {
375-
return getDocument().body.contains(elt);
376-
}
377-
}
371+
function bodyContains(elt) {
372+
// IE Fix
373+
if (elt.getRootNode && elt.getRootNode() instanceof ShadowRoot) {
374+
return getDocument().body.contains(elt.getRootNode().host);
375+
} else {
376+
return getDocument().body.contains(elt);
377+
}
378+
}
378379

379380
function splitOnWhitespace(trigger) {
380381
return trigger.trim().split(/\s+/);

www/js/htmx.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -368,13 +368,14 @@ return (function () {
368368
return elemTop < window.innerHeight && elemBottom >= 0;
369369
}
370370

371-
function bodyContains(elt) {
372-
if (elt.getRootNode() instanceof ShadowRoot) {
373-
return getDocument().body.contains(elt.getRootNode().host);
374-
} else {
375-
return getDocument().body.contains(elt);
376-
}
377-
}
371+
function bodyContains(elt) {
372+
// IE Fix
373+
if (elt.getRootNode && elt.getRootNode() instanceof ShadowRoot) {
374+
return getDocument().body.contains(elt.getRootNode().host);
375+
} else {
376+
return getDocument().body.contains(elt);
377+
}
378+
}
378379

379380
function splitOnWhitespace(trigger) {
380381
return trigger.trim().split(/\s+/);

www/test/1.8.3/src/htmx.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -368,13 +368,14 @@ return (function () {
368368
return elemTop < window.innerHeight && elemBottom >= 0;
369369
}
370370

371-
function bodyContains(elt) {
372-
if (elt.getRootNode() instanceof ShadowRoot) {
373-
return getDocument().body.contains(elt.getRootNode().host);
374-
} else {
375-
return getDocument().body.contains(elt);
376-
}
377-
}
371+
function bodyContains(elt) {
372+
// IE Fix
373+
if (elt.getRootNode && elt.getRootNode() instanceof ShadowRoot) {
374+
return getDocument().body.contains(elt.getRootNode().host);
375+
} else {
376+
return getDocument().body.contains(elt);
377+
}
378+
}
378379

379380
function splitOnWhitespace(trigger) {
380381
return trigger.trim().split(/\s+/);

0 commit comments

Comments
 (0)