mirror of
				https://github.com/TeamPiped/Piped.git
				synced 2024-08-14 23:57:27 +00:00 
			
		
		
		
	Fix scrolling issue.
Looks like Vue Router's scrollBehavior is broken.
This commit is contained in:
		
							parent
							
								
									bc2603fd20
								
							
						
					
					
						commit
						dce45d8592
					
				
					 2 changed files with 4 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -149,6 +149,7 @@ export default {
 | 
			
		|||
                this.getVideoData();
 | 
			
		||||
                this.getSponsors();
 | 
			
		||||
                this.getComments();
 | 
			
		||||
                window.scrollTo(0, 0);
 | 
			
		||||
            }
 | 
			
		||||
        },
 | 
			
		||||
    },
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -34,6 +34,9 @@ const routes = [
 | 
			
		|||
const router = createRouter({
 | 
			
		||||
    history: createWebHistory(),
 | 
			
		||||
    routes,
 | 
			
		||||
    scrollBehavior: function(_to, _from, savedPosition) {
 | 
			
		||||
        return savedPosition ? savedPosition : window.scrollTo(0, 0);
 | 
			
		||||
    },
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
export default router;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue