File tree Expand file tree Collapse file tree 4 files changed +10
-6
lines changed
Expand file tree Collapse file tree 4 files changed +10
-6
lines changed Original file line number Diff line number Diff line change 372372 // Start with the parent of the spawner for this floating menu and keep widening the search for any other valid spawners that are hover-transferrable
373373 let currentAncestor = (targetSpawner && ownSpawner ?.parentElement ) || undefined ;
374374 while (currentAncestor ) {
375+ // If the current ancestor blocks hover transfer, stop searching
376+ if (currentAncestor .hasAttribute (" data-block-hover-transfer" )) break ;
377+
375378 const ownSpawnerDepthFromCurrentAncestor = ownSpawner && getDepthFromAncestor (ownSpawner , currentAncestor );
376379 const currentAncestor2 = currentAncestor ; // This duplicate variable avoids an ESLint warning
377380
382385 const notOurself = ! ownDescendantMenuSpawners .includes (item );
383386 // And filter away unequal depths from the current ancestor
384387 const notUnequalDepths = notOurself && getDepthFromAncestor (item , currentAncestor2 ) === ownSpawnerDepthFromCurrentAncestor ;
385- // And filter away elements that explicitly disable hover transfer
386- return notUnequalDepths && ! (item as HTMLElement ). getAttribute ?. (" data-floating-menu-spawner " )?. includes ( " no- hover-transfer" );
388+ // And filter away descendants that explicitly disable hover transfer
389+ return notUnequalDepths && ! (item instanceof HTMLElement && item . hasAttribute (" data-block- hover-transfer" ) );
387390 });
388391
389392 // If none were found, widen the search by a level and keep trying (or stop looping if the root was reached)
Original file line number Diff line number Diff line change 5959 />
6060 </button >
6161 {#if expanded }
62- <LayoutCol class =" body" >
62+ <LayoutCol class =" body" data-block-hover-transfer >
6363 {#each widgetData .layout as layoutGroup }
6464 {#if isWidgetSpanRow (layoutGroup )}
6565 <WidgetSpan widgetData ={layoutGroup } {layoutTarget } />
Original file line number Diff line number Diff line change 7272 data-disabled ={disabled || undefined }
7373 data-text-button
7474 tabindex ={disabled ? - 1 : 0 }
75- data-floating-menu-spawner ={menuListChildrenExists ? " " : " no-hover-transfer" }
75+ data-floating-menu-spawner
76+ data-block-hover-transfer ={menuListChildrenExists ? undefined : " " }
7677 on:click ={onClick }
7778 >
7879 {#if icon }
Original file line number Diff line number Diff line change 3737
3838<LayoutCol class =" working-colors-button" >
3939 <LayoutRow class =" primary swatch" >
40- <button on:click ={clickPrimarySwatch } class:open ={primaryOpen } style:--swatch-color ={primary .toRgbaCSS ()} data-floating-menu-spawner = " no- hover-transfer" tabindex =" 0" ></button >
40+ <button on:click ={clickPrimarySwatch } class:open ={primaryOpen } style:--swatch-color ={primary .toRgbaCSS ()} data-floating-menu-spawner data-block- hover-transfer tabindex =" 0" ></button >
4141 <ColorPicker
4242 open ={primaryOpen }
4343 on:open ={({ detail }) => (primaryOpen = detail )}
4747 />
4848 </LayoutRow >
4949 <LayoutRow class =" secondary swatch" >
50- <button on:click ={clickSecondarySwatch } class:open ={secondaryOpen } style:--swatch-color ={secondary .toRgbaCSS ()} data-floating-menu-spawner = " no- hover-transfer" tabindex =" 0" ></button >
50+ <button on:click ={clickSecondarySwatch } class:open ={secondaryOpen } style:--swatch-color ={secondary .toRgbaCSS ()} data-floating-menu-spawner data-block- hover-transfer tabindex =" 0" ></button >
5151 <ColorPicker
5252 open ={secondaryOpen }
5353 on:open ={({ detail }) => (secondaryOpen = detail )}
You can’t perform that action at this time.
0 commit comments