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 = {
6666 } ,
6767
6868 _updateScroll : function ( prevState ) {
69- if ( ! shouldUpdateScroll ( this . state , prevState ) ) {
69+ if ( ! shouldUpdateScroll ( this . state , prevState ) )
7070 return ;
71- }
7271
7372 var scrollBehavior = this . getScrollBehavior ( ) ;
7473
Original file line number Diff line number Diff line change @@ -277,17 +277,18 @@ function createRouter(options) {
277277 */
278278 dispatch : function ( path , action , callback ) {
279279 if ( pendingTransition ) {
280- pendingTransition . abort ( new Cancellation ( ) ) ;
280+ pendingTransition . abort ( new Cancellation ) ;
281281 pendingTransition = null ;
282282 }
283283
284284 var prevPath = state . path ;
285285 if ( prevPath === path )
286286 return ; // Nothing to do!
287287
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 )
289291 this . recordScrollPosition ( prevPath ) ;
290- }
291292
292293 var pathname = Path . withoutQuery ( path ) ;
293294 var match = this . match ( pathname ) ;
You can’t perform that action at this time.
0 commit comments