fix(nav): remove hover popover open delay to prevent flickering - #2133
Conversation
|
@ernestt must be a member of the Meta Open Source team on Vercel to deploy. Learn more about collaboration on Vercel and other options here. |
cixzhang
left a comment
There was a problem hiding this comment.
Seems okay. It should only affects the hover open pathway but might be annoying if the user is scanning. I guess we can try it and see.
XDSSideNavHeading and XDSTopNavHeading are single-item triggers where the 150ms show delay was causing visible flickering without serving its debounce purpose (there's only one heading, not a row of items). Pass showDelay: 0 to useXDSMenuHover in both heading components so the popover opens immediately on hover. The hook is also updated to skip the unnecessary setTimeout when showDelay is 0. Other nav items (XDSTopNavMenu, XDSTopNavMegaMenu, XDSSideNavItem) keep their 150ms delay since they appear in groups where debouncing is useful.
9981696 to
bcc78a2
Compare
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
PR Analysis Report📚 Storybook PreviewView Storybook for this PR 🧪 Sandbox PreviewView Sandbox for this PR No new or modified components detected. Bundle Size Summary
Accessibility AuditStatus: No accessibility violations detected. Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
XDSSideNavHeading and XDSTopNavHeading are single-item triggers where the 150ms show delay was causing visible flickering without serving its debounce purpose (there's only one heading, not a row of items). Pass showDelay: 0 to useXDSMenuHover in both heading components so the popover opens immediately on hover. The hook is also updated to skip the unnecessary setTimeout when showDelay is 0. Other nav items (XDSTopNavMenu, XDSTopNavMegaMenu, XDSSideNavItem) keep their 150ms delay since they appear in groups where debouncing is useful.
XDSSideNavHeading and XDSTopNavHeading are single-item triggers where the 150ms show delay was causing visible flickering without serving its debounce purpose (there's only one heading, not a row of items). Pass showDelay: 0 to useXDSMenuHover in both heading components so the popover opens immediately on hover. The hook is also updated to skip the unnecessary setTimeout when showDelay is 0. Other nav items (XDSTopNavMenu, XDSTopNavMegaMenu, XDSSideNavItem) keep their 150ms delay since they appear in groups where debouncing is useful.
Summary
Removes the 150ms show delay on nav heading hover menus (
XDSSideNavHeadingandXDSTopNavHeading) to prevent flickering.Problem
The heading popover menus had a 150ms delay before opening on hover (inherited from the shared
useXDSMenuHoverhook default). Unlike nav items/menus which appear in groups where debouncing prevents accidental triggers, the heading is always a single target — the delay just caused visible flicker with no upside.Changes
XDSSideNavHeading— passesshowDelay: 0touseXDSMenuHoverXDSTopNavHeading— passesshowDelay: 0touseXDSMenuHoveruseXDSMenuHover— whenshowDelayis 0, callsshow()synchronously instead of wrapping in an unnecessarysetTimeout(..., 0)Not changed
XDSTopNavMenu,XDSTopNavMegaMenu, andXDSSideNavItemkeep their 150ms delay since they appear in groups where debouncing across multiple targets is useful.