mirror of
https://github.com/bigskysoftware/htmx.git
synced 2025-09-28 13:31:06 +00:00
handle situation where body has been deleted
fixes https://github.com/bigskysoftware/htmx/issues/2710
This commit is contained in:
parent
89dc9bea2e
commit
ce46e436fd
7
dist/htmx.amd.js
vendored
7
dist/htmx.amd.js
vendored
@ -773,10 +773,13 @@ var htmx = (function() {
|
||||
function bodyContains(elt) {
|
||||
// IE Fix
|
||||
const rootNode = elt.getRootNode && elt.getRootNode()
|
||||
if (getDocument().body === null) {
|
||||
return false;
|
||||
}
|
||||
if (rootNode && rootNode instanceof window.ShadowRoot) {
|
||||
return getDocument().body.contains(rootNode.host)
|
||||
return getDocument().body.contains(rootNode.host);
|
||||
} else {
|
||||
return getDocument().body.contains(elt)
|
||||
return getDocument().body.contains(elt);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user