mirror of
				https://github.com/TriliumNext/Notes.git
				synced 2025-11-04 15:11:31 +08:00 
			
		
		
		
	fix(tab-row): ensure similar behavior between horizontal/vertical scrolling
This commit is contained in:
		
							parent
							
								
									99d26b794d
								
							
						
					
					
						commit
						be8ee350cb
					
				@ -405,11 +405,12 @@ export default class TabRowWidget extends BasicWidget {
 | 
				
			|||||||
            }
 | 
					            }
 | 
				
			||||||
            event.preventDefault();
 | 
					            event.preventDefault();
 | 
				
			||||||
            event.stopImmediatePropagation();
 | 
					            event.stopImmediatePropagation();
 | 
				
			||||||
            if (!event.shiftKey) {                 
 | 
					
 | 
				
			||||||
                // Set an upper limit to avoid scrolling too fast
 | 
					            // Set an upper limit to avoid scrolling too fast
 | 
				
			||||||
                // no lower limit is set because touchpad deltas are usually small
 | 
					            // no lower limit is set because touchpad deltas are usually small
 | 
				
			||||||
                const delta = Math.sign( event.deltaX + event.deltaY ) * Math.min(Math.abs(event.deltaX + event.deltaY), TAB_CONTAINER_MIN_WIDTH * 3);
 | 
					            const delta = Math.sign(event.deltaX + event.deltaY) * Math.min(Math.abs(event.deltaX + event.deltaY), TAB_CONTAINER_MIN_WIDTH * 3);
 | 
				
			||||||
                
 | 
					            
 | 
				
			||||||
 | 
					            if (!event.shiftKey) {                                 
 | 
				
			||||||
                // Check if the device has reduced motion enabled
 | 
					                // Check if the device has reduced motion enabled
 | 
				
			||||||
                if (window.matchMedia('(prefers-reduced-motion: reduce)').matches) {
 | 
					                if (window.matchMedia('(prefers-reduced-motion: reduce)').matches) {
 | 
				
			||||||
                    this.scrollTabContainer(delta, "instant");
 | 
					                    this.scrollTabContainer(delta, "instant");
 | 
				
			||||||
@ -421,7 +422,7 @@ export default class TabRowWidget extends BasicWidget {
 | 
				
			|||||||
                    }
 | 
					                    }
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
            } else if (event.shiftKey) {
 | 
					            } else if (event.shiftKey) {
 | 
				
			||||||
                if (event.deltaY > 0) {
 | 
					                if (delta > 0) {
 | 
				
			||||||
                    await appContext.tabManager.activateNextTabCommand();
 | 
					                    await appContext.tabManager.activateNextTabCommand();
 | 
				
			||||||
                } else {
 | 
					                } else {
 | 
				
			||||||
                    await appContext.tabManager.activatePreviousTabCommand();
 | 
					                    await appContext.tabManager.activatePreviousTabCommand();
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user