Do not go further than the modal window when computing the scrollable ancestors
Closes #15143
This commit is contained in:
+5
-2
@@ -89,13 +89,16 @@
|
||||
function getScrollableAncestors(el) {
|
||||
let ancestors = [];
|
||||
let parent = el.parentElement;
|
||||
while (parent && parent !== document.body) {
|
||||
while (parent && (parent !== document.body ||
|
||||
!parent.classList.contains('modal'))) {
|
||||
if (isScrollable(parent)) {
|
||||
ancestors.push(parent);
|
||||
}
|
||||
parent = parent.parentElement;
|
||||
}
|
||||
ancestors.push(window);
|
||||
if (!parent.classList.contains('modal')) {
|
||||
ancestors.push(window);
|
||||
}
|
||||
return ancestors;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user