@@ -4,7 +4,7 @@ import { setContextMenu } from "../Menu";
44import { iconClose , iconDuplicate , iconNew , iconRefresh } from "../../icons" ;
55import { browser , forceScreenshot } from "../../Browser" ;
66import { Icon } from "../Icon" ;
7- import { TabTooltip } from "./TabTooltip" ;
7+ import { activeTooltips , TabTooltip } from "./TabTooltip" ;
88
99export function DragTab (
1010 this : { tooltipActive : boolean } ,
@@ -92,11 +92,22 @@ export function DragTab(
9292 on :mouseenter = { ( ) => {
9393 forceScreenshot ( props . tab ) ;
9494 if ( hoverTimeout ) clearTimeout ( hoverTimeout ) ;
95- hoverTimeout = window . setTimeout ( ( ) => {
95+
96+ if ( activeTooltips > 0 ) {
97+ // skip delay
9698 this . tooltipActive = true ;
97- } , 500 ) ;
99+ } else {
100+ hoverTimeout = window . setTimeout ( ( ) => {
101+ this . tooltipActive = true ;
102+ } , 500 ) ;
103+ }
98104 } }
99- on :mouseleave = { ( ) => {
105+ on :mouseleave = { ( e : MouseEvent ) => {
106+ const relatedTarget = e . relatedTarget as Node | null ;
107+ if ( relatedTarget && cx . root . contains ( relatedTarget ) ) {
108+ // don't dismiss if hovering over the close button, even though that takes focus away from hover-area
109+ return ;
110+ }
100111 if ( hoverTimeout ) clearTimeout ( hoverTimeout ) ;
101112 this . tooltipActive = false ;
102113 } }
@@ -217,7 +228,8 @@ DragTab.style = css`
217228 border-radius : 3px ;
218229 }
219230
220- : scope : has (.hover-area : hover ) .main : not (.active ) {
231+ : scope : has (.hover-area : hover ) .main : not (.active ),
232+ : scope : has (.close : hover ) .main : not (.active ) {
221233 transition : background 250ms ;
222234 background-color : color-mix (in srgb, currentColor 7% , transparent);
223235 /*background: var(--background_tab);*/
0 commit comments