scrollToViewer () {
const { container } = this.refs;
const top = container.getBoundingClientRect().top + window.scrollY - 95 - 10;
- window.scrollTo(0, top);
+
+ // scroll only to top
+ if (window.scrollY > top) {
+ window.scrollTo(0, top);
+ }
}
scrollToStoredPosition () {
scrollToViewer () {
const { container } = this.refs;
const top = container.getBoundingClientRect().top + window.scrollY - 95 - 10;
- window.scrollTo(0, top);
+
+ // scroll only to top
+ if (window.scrollY > top) {
+ window.scrollTo(0, top);
+ }
}
scrollToStoredPosition () {