diff --git a/components/_util/scrollTo.ts b/components/_util/scrollTo.ts index 1c79cc93cbf1..b3648407d307 100644 --- a/components/_util/scrollTo.ts +++ b/components/_util/scrollTo.ts @@ -24,8 +24,8 @@ export default function scrollTo(y: number, options: ScrollToOptions = {}) { const nextScrollTop = easeInOutCubic(time > duration ? duration : time, scrollTop, y, duration); if (isWindow(container)) { (container as Window).scrollTo(window.pageXOffset, nextScrollTop); - } else if (container instanceof Document) { - container.documentElement.scrollTop = nextScrollTop; + } else if (container instanceof HTMLDocument || container.constructor.name === 'HTMLDocument') { + (container as HTMLDocument).documentElement.scrollTop = nextScrollTop; } else { (container as HTMLElement).scrollTop = nextScrollTop; }