mirror of
				https://github.com/notion-enhancer/notion-enhancer.git
				synced 2025-11-04 08:08:08 +11:00 
			
		
		
		
	fix(panel): queue panel close after peek animation ends if no longer hovering
This commit is contained in:
		
							parent
							
								
									493db7aa2e
								
							
						
					
					
						commit
						69eb2866d5
					
				@ -301,6 +301,12 @@ function Panel({
 | 
				
			|||||||
    if (isPeeked() || !panelViews.length) return;
 | 
					    if (isPeeked() || !panelViews.length) return;
 | 
				
			||||||
    if (isClosed()) Object.assign(animationState, peekAnimation);
 | 
					    if (isClosed()) Object.assign(animationState, peekAnimation);
 | 
				
			||||||
    animatePanel({ ...openWidth, ...peekAnimation });
 | 
					    animatePanel({ ...openWidth, ...peekAnimation });
 | 
				
			||||||
 | 
					    // closing on mouseout is disabled mid-animation,
 | 
				
			||||||
 | 
					    // queue close in case mouse is no longer peeking
 | 
				
			||||||
 | 
					    // after the initial animation is complete
 | 
				
			||||||
 | 
					    setTimeout(() => {
 | 
				
			||||||
 | 
					      if (!isDragging() && !$panel.matches(":hover")) $panel.close();
 | 
				
			||||||
 | 
					    }, transitionDuration);
 | 
				
			||||||
    $panel.removeAttribute("data-pinned");
 | 
					    $panel.removeAttribute("data-pinned");
 | 
				
			||||||
    $panel.dataset.peeked = true;
 | 
					    $panel.dataset.peeked = true;
 | 
				
			||||||
    setInteractive(true);
 | 
					    setInteractive(true);
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user