mirror of
				https://codeberg.org/yeentown/barkey.git
				synced 2025-10-31 13:34:12 +00:00 
			
		
		
		
	chore(client): tweak scroll behavior in routing
This commit is contained in:
		
							parent
							
								
									b31f09692a
								
							
						
					
					
						commit
						f22c32af05
					
				
					 1 changed files with 2 additions and 2 deletions
				
			
		|  | @ -451,7 +451,7 @@ mainRouter.addListener('push', ctx => { | ||||||
| 	if (scrollPos !== 0) { | 	if (scrollPos !== 0) { | ||||||
| 		window.setTimeout(() => { // 遷移直後はタイミングによってはコンポーネントが復元し切ってない可能性も考えられるため少し時間を空けて再度スクロール
 | 		window.setTimeout(() => { // 遷移直後はタイミングによってはコンポーネントが復元し切ってない可能性も考えられるため少し時間を空けて再度スクロール
 | ||||||
| 			window.scroll({ top: scrollPos, behavior: 'instant' }); | 			window.scroll({ top: scrollPos, behavior: 'instant' }); | ||||||
| 		}, 1000); | 		}, 100); | ||||||
| 	} | 	} | ||||||
| }); | }); | ||||||
| 
 | 
 | ||||||
|  | @ -469,7 +469,7 @@ window.addEventListener('popstate', (event) => { | ||||||
| 	window.scroll({ top: scrollPos, behavior: 'instant' }); | 	window.scroll({ top: scrollPos, behavior: 'instant' }); | ||||||
| 	window.setTimeout(() => { // 遷移直後はタイミングによってはコンポーネントが復元し切ってない可能性も考えられるため少し時間を空けて再度スクロール
 | 	window.setTimeout(() => { // 遷移直後はタイミングによってはコンポーネントが復元し切ってない可能性も考えられるため少し時間を空けて再度スクロール
 | ||||||
| 		window.scroll({ top: scrollPos, behavior: 'instant' }); | 		window.scroll({ top: scrollPos, behavior: 'instant' }); | ||||||
| 	}, 1000); | 	}, 100); | ||||||
| }); | }); | ||||||
| 
 | 
 | ||||||
| export function useRouter(): Router { | export function useRouter(): Router { | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		
		Reference in a new issue