Skip to content

Commit

Permalink
🐛 Fix Backtop cannot work in Chrome iframe (#24194)
Browse files Browse the repository at this point in the history
close #24192
  • Loading branch information
afc163 committed May 15, 2020
1 parent a83143b commit 04ad723
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions components/_util/scrollTo.ts
Expand Up @@ -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;
}
Expand Down

0 comments on commit 04ad723

Please sign in to comment.