提交 00da064b 编写于 作者: K Kamran Ahmed

Fix - Scroll not working

上级 1923a660
......@@ -77,7 +77,7 @@ export default class Element {
return;
}
const elementRect = this.getCalculatedPosition();
const elementRect = this.node.getBoundingClientRect();
const absoluteElementTop = elementRect.top + this.window.pageYOffset;
const middle = absoluteElementTop - (this.window.innerHeight / 2);
......@@ -152,13 +152,13 @@ export default class Element {
// If this element is not already highlighted (because this call could
// be from the resize or scroll) and is not in view
if (highlightedNode !== lastHighlightedNode) {
if (!highlightedElement.isInView()) {
highlightedElement.bringInView();
}
if (popoverElement && !popoverElement.isInView()) {
popoverElement.bringInView();
}
if (!highlightedElement.isInView()) {
highlightedElement.bringInView();
}
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册