Skip to content

Commit 29c59a8

Browse files
committed
🛠 remove scroll listener before setting scroll
Fixes #679
1 parent 4e6a053 commit 29c59a8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

‎js/history.js‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@ proto.createHistoryPageLoad = function() {
9292
this.on( 'load', this.onPageLoadHistory );
9393
};
9494

95-
InfiniteScroll.destroy.history = function() {
95+
InfiniteScroll.destroy.history =
96+
proto.destroyHistory = function() {
9697
var isHistoryAppend = this.options.history && this.options.append;
9798
if ( isHistoryAppend ) {
9899
this.bindHistoryAppendEvents( false );
@@ -187,6 +188,8 @@ proto.onBeforeunload = function() {
187188
// calculate where scroll position would be on refresh
188189
var scrollPage = this.scrollPages[ pageIndex ];
189190
var scrollY = window.pageYOffset - scrollPage.top + this.top;
191+
// disable scroll event before setting scroll #679
192+
this.destroyHistory();
190193
scrollTo( 0, scrollY );
191194
};
192195

0 commit comments

Comments
 (0)