[OpenNMS/opennms] d680ad: NMS-20273: Address PR review on the hover flyouts
Scott Theleman via opennms-cvs <[email protected]>
| Newsgroups | gmane.network.opennms.cvs |
|---|---|
| Message-ID | <OpenNMS/opennms/push/refs/heads/jira/NMS-20273-sidemenu-hover-flyout-when-collapsed-smoke/[email protected]> |
Branch: refs/heads/jira/NMS-20273-sidemenu-hover-flyout-when-collapsed-smoke
Home: https://github.com/OpenNMS/opennms
Commit: d680ad69bf0511fa01d94a098d947b1ff8f7b602
https://github.com/OpenNMS/opennms/commit/d680ad69bf0511fa01d94a098d947b1ff8f7b602
Author: Scott Theleman <[email protected]>
Date: 2026-08-31 (Mon, 31 Aug 2026)
Changed paths:
M ui/src/components/Menu/SideMenu.vue
M ui/tests/components/Menu/SideMenu.test.ts
Log Message:
-----------
NMS-20273: Address PR review on the hover flyouts
Three fixes, all in the hover teardown path, plus one shared helper for
it.
A pending dwell was not cancelled when the pointer moved onto the
rail's own chrome. closest() returns null for the toggle button and the
gap below the last entry, and the handler returned early without
clearing the timer or hoveredItem — so the timer's only guard
(hoveredItem !== item) still held and it fired, opening a flyout for an
entry the pointer had already left. Reaching for the collapse toggle
after hovering an entry is the common case. Clearing hoveredItem there
also re-arms the dwell when the pointer comes back to that same entry,
which the old code left inert.
togglePinned left `dirty` set, contradicting its own comment.
TieredMenu never clears it when the active path empties, which happens
whenever a direct link (Topology, the maps) is hovered in hover mode,
so the activeItemPath guard skipped hide() and the rail stayed in hover
mode across the toggle — every subsequent hover opening with no dwell.
The rail's mouseleave discarded keyboard state: hide() resets
focusedItemInfo, and it ran whether the flyout had been hovered open or
clicked/tabbed into. Hover never focuses the menubar (verified in a
browser: a hover leaves activeElement on <body>, a click moves it to
the menubar <ul>), so `focused` cleanly separates the two. When the
menu holds focus, the focused index is now put back on the root entry
that was open — where TieredMenu itself lands after closing a submenu.
A deeper position is deliberately not restored as-is: it points into a
submenu that is now closed, and TieredMenu would resolve the stale
index against the root list.
The close-and-leave-hover-mode logic was duplicated between
togglePinned and the mouseleave timer; both now call one closeFlyouts()
helper.
Reviewed and not changed: `hasSubmenu` in the #item slot. TieredMenuSub
binds it as :hasSubmenu="!!getItemProp(processedItem, 'items')" — the
double-bang is on the slot binding, so it is already a boolean and
matches the .d.ts. The two tooltip assertions use toBe(), which is
Object.is: an items array would not equal true, nor undefined false.
To unsubscribe from these emails, change your notification settings at https://github.com/OpenNMS/opennms/settings/notifications
_______________________________________________
Please read the OpenNMS Mailing List FAQ:
http://www.opennms.org/wiki/index.php?page=MailingListFaq
opennms-cvs mailing list
To *unsubscribe* or change your subscription options, see the bottom of this page:
https://lists.sourceforge.net/lists/listinfo/opennms-cvs