mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-24 11:10:01 +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];
|
||||
}
|
||||
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
|
||||
];
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user