check null for document.body and document.documentElement inside function isWindowScrollable (#2028)
This commit is contained in:
@@ -1993,11 +1993,15 @@ async function scrollToNextPage(
|
|||||||
}
|
}
|
||||||
|
|
||||||
function isWindowScrollable() {
|
function isWindowScrollable() {
|
||||||
|
const documentBody = document.body;
|
||||||
|
const documentElement = document.documentElement;
|
||||||
|
if (!documentBody || !documentElement) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// Check if the body's overflow style is set to hidden
|
// Check if the body's overflow style is set to hidden
|
||||||
const bodyOverflow = getElementComputedStyle(document.body)?.overflow;
|
const bodyOverflow = getElementComputedStyle(documentBody)?.overflow;
|
||||||
const htmlOverflow = getElementComputedStyle(
|
const htmlOverflow = getElementComputedStyle(documentElement)?.overflow;
|
||||||
document.documentElement,
|
|
||||||
)?.overflow;
|
|
||||||
|
|
||||||
// Check if the document height is greater than the window height
|
// Check if the document height is greater than the window height
|
||||||
const isScrollable =
|
const isScrollable =
|
||||||
|
|||||||
Reference in New Issue
Block a user