Commit 45a3d2c5 by FE

search position question

parent 56ac421b
...@@ -76,8 +76,9 @@ class SearchResult extends PureComponent { ...@@ -76,8 +76,9 @@ class SearchResult extends PureComponent {
} }
handleScroll = throttle(() => { handleScroll = throttle(() => {
let y = window.scrollY, headY = this.searchHead.current.offsetTop let y = window.scrollY,
if (y < this.prevScrollY) { headY = this.searchHead.current.offsetTop;
if (y < this.prevScrollY && y > 0) {
if (this.state.swipeDirection === this.swipeDown) { if (this.state.swipeDirection === this.swipeDown) {
...@@ -114,7 +115,7 @@ class SearchResult extends PureComponent { ...@@ -114,7 +115,7 @@ class SearchResult extends PureComponent {
}) })
} }
this.prevScrollY = y this.prevScrollY = y;
}, 0) }, 0)
render() { render() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment