mirror of
https://github.com/ant-design/ant-design.git
synced 2025-06-07 17:44:35 +08:00
fix: error when target not an html element (#29523)
fix error when target is object but not an html element
This commit is contained in:
parent
4d3b2d87c1
commit
290aa1adf3
@ -19,7 +19,7 @@ export default function getScroll(
|
|||||||
result = (target as HTMLElement)[method];
|
result = (target as HTMLElement)[method];
|
||||||
}
|
}
|
||||||
if (target && !isWindow(target) && typeof result !== 'number') {
|
if (target && !isWindow(target) && typeof result !== 'number') {
|
||||||
result = ((target as HTMLElement).ownerDocument || (target as Document)).documentElement[
|
result = ((target as HTMLElement).ownerDocument || (target as Document)).documentElement?.[
|
||||||
method
|
method
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user