1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-09-02 19:52:32 +02:00

Improve mentions example by including scroll calculation (#2883)

This commit is contained in:
Matthew Herbst
2019-07-03 12:53:44 -07:00
committed by Ian Storm Taylor
parent 7d4062cde9
commit 5222515c0c

View File

@@ -100,8 +100,8 @@ class Suggestions extends React.PureComponent {
const anchorRect = anchor.getBoundingClientRect() const anchorRect = anchor.getBoundingClientRect()
this.setState({ this.setState({
top: anchorRect.bottom, top: anchorRect.bottom + window.pageYOffset,
left: anchorRect.left, left: anchorRect.left + window.pageXOffset,
}) })
} }
} }