mirror of
https://github.com/discourse/discourse.git
synced 2025-05-28 01:56:58 +08:00
This reverts commit abcdd8d367e8db430119f847f029e9cc94e62cb6.
This commit is contained in:
@ -1,13 +0,0 @@
|
||||
export function getScrollParent(node) {
|
||||
const isElement = node instanceof HTMLElement;
|
||||
const overflowY = isElement && window.getComputedStyle(node).overflowY;
|
||||
const isScrollable = overflowY !== "visible" && overflowY !== "hidden";
|
||||
|
||||
if (!node || node === document.documentElement) {
|
||||
return null;
|
||||
} else if (isScrollable && node.scrollHeight >= node.clientHeight) {
|
||||
return node;
|
||||
}
|
||||
|
||||
return getScrollParent(node.parentNode) || window;
|
||||
}
|
Reference in New Issue
Block a user