File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -66,9 +66,8 @@ var Scrolling = {
66
66
} ,
67
67
68
68
_updateScroll : function ( prevState ) {
69
- if ( ! shouldUpdateScroll ( this . state , prevState ) ) {
69
+ if ( ! shouldUpdateScroll ( this . state , prevState ) )
70
70
return ;
71
- }
72
71
73
72
var scrollBehavior = this . getScrollBehavior ( ) ;
74
73
Original file line number Diff line number Diff line change @@ -277,17 +277,18 @@ function createRouter(options) {
277
277
*/
278
278
dispatch : function ( path , action , callback ) {
279
279
if ( pendingTransition ) {
280
- pendingTransition . abort ( new Cancellation ( ) ) ;
280
+ pendingTransition . abort ( new Cancellation ) ;
281
281
pendingTransition = null ;
282
282
}
283
283
284
284
var prevPath = state . path ;
285
285
if ( prevPath === path )
286
286
return ; // Nothing to do!
287
287
288
- if ( prevPath && action !== LocationActions . REPLACE ) {
288
+ // Record the scroll position as early as possible to
289
+ // get it before browsers try update it automatically.
290
+ if ( prevPath && action !== LocationActions . REPLACE )
289
291
this . recordScrollPosition ( prevPath ) ;
290
- }
291
292
292
293
var pathname = Path . withoutQuery ( path ) ;
293
294
var match = this . match ( pathname ) ;
You can’t perform that action at this time.
0 commit comments