mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-05 00:43:53 +00:00
fix-scroll-bug (#2746)
This commit is contained in:
@@ -422,7 +422,10 @@ class DraftReview extends React.Component {
|
|||||||
}
|
}
|
||||||
if (typeof(key) === 'string') {
|
if (typeof(key) === 'string') {
|
||||||
const win = window;
|
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 scroller = this.findScrollContainer(element, win);
|
||||||
const isWindow = scroller == win.document.body || scroller == win.document.documentElement;
|
const isWindow = scroller == win.document.body || scroller == win.document.documentElement;
|
||||||
if (isWindow) {
|
if (isWindow) {
|
||||||
|
Reference in New Issue
Block a user