1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-02 23:48:47 +00:00

fix-scroll-bug (#2746)

This commit is contained in:
Michael An
2019-01-03 08:36:38 +08:00
committed by Daniel Pan
parent 9794966b89
commit 9fbcefc465

View File

@@ -422,7 +422,10 @@ class DraftReview extends React.Component {
}
if (typeof(key) === 'string') {
const win = window;
const element = win.document.querySelector(`[data-key="${key}"]`);
let element = win.document.querySelector(`[data-key="${key}"]`);
while (element.tagName === "CODE") {
element = element.parentNode;
}
const scroller = this.findScrollContainer(element, win);
const isWindow = scroller == win.document.body || scroller == win.document.documentElement;
if (isWindow) {