@joewinke/jatui 0.5.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -125,7 +125,13 @@
|
|
|
125
125
|
}
|
|
126
126
|
|
|
127
127
|
function handleItemPointerEnter(item: ActionItem, index: number, event: PointerEvent) {
|
|
128
|
-
|
|
128
|
+
// Entering an item WITHOUT a submenu must close any open submenu —
|
|
129
|
+
// otherwise hover-scrolling past a submenu parent (e.g. "Classify
|
|
130
|
+
// sender") leaves its panel stuck open over the rest of the menu.
|
|
131
|
+
if (item.disabled || !item.submenu?.length) {
|
|
132
|
+
closeSubmenu();
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
129
135
|
const el = event.currentTarget as HTMLElement;
|
|
130
136
|
openSubmenuAt(el, index);
|
|
131
137
|
}
|
|
@@ -289,7 +295,7 @@
|
|
|
289
295
|
aria-expanded={item.submenu?.length ? submenuIndex === i : undefined}
|
|
290
296
|
aria-label={item.content ? item.label : undefined}
|
|
291
297
|
class="w-full flex items-center gap-2 text-left px-3 py-1.5 text-sm transition-colors
|
|
292
|
-
{item.variant === 'danger' ? 'text-error hover:bg-error/10' : 'hover:bg-base-
|
|
298
|
+
{item.variant === 'danger' ? 'text-error hover:bg-error/10' : 'hover:bg-base-300'}
|
|
293
299
|
{item.disabled ? 'opacity-50 cursor-not-allowed' : ''}"
|
|
294
300
|
disabled={item.disabled}
|
|
295
301
|
onclick={(e) => handleItemClick(item, i, e)}
|
|
@@ -297,6 +303,10 @@
|
|
|
297
303
|
onfocus={(e) => {
|
|
298
304
|
if (item.submenu?.length && !item.disabled) {
|
|
299
305
|
openSubmenuAt(e.currentTarget as HTMLElement, i);
|
|
306
|
+
} else {
|
|
307
|
+
// Arrow-navigating onto a submenu-less item closes any
|
|
308
|
+
// open submenu, same as pointer hover.
|
|
309
|
+
closeSubmenu();
|
|
300
310
|
}
|
|
301
311
|
}}
|
|
302
312
|
>
|