fix(popover): keep the last-hovered row highlighted when the pointer leaves
The surface's onMouseLeave nulled hoverIndex, so moving the pointer off a menu snapped the highlight back to activeIndex — the first item in a menu with a free-text input (ChannelTags), where the field swallows arrow keys so there is no list-nav holding a keyboard position. The keyboard and typeahead already reclaim the highlight by nulling hoverIndex in onNavigate/onMatch, so the mouseleave reset was redundant; dropping it keeps the last hover. 0.60.3.
This commit is contained in:
@@ -440,12 +440,12 @@ function PopoverSurfaceInner({
|
||||
positioned element is essential: the popIn keyframe animates `transform`, which would
|
||||
otherwise override Floating UI's `transform: translate(x,y)` and park the popover at (0,0)
|
||||
for the animation's duration — the "flash in the top-left corner" bug. */}
|
||||
<div
|
||||
className={className}
|
||||
style={style}
|
||||
// Pointer left the menu → drop the hover highlight so it returns to the keyboard position.
|
||||
onMouseLeave={() => setHoverIndex(null)}
|
||||
>
|
||||
<div className={className} style={style}>
|
||||
{/* Intentionally NO onMouseLeave hover-reset: when the pointer leaves, the last-hovered row
|
||||
stays highlighted (feels natural, and a menu with a free-text input like ChannelTags — where
|
||||
the field swallows arrow keys, so there is no list-nav — has nothing to reclaim it otherwise,
|
||||
so it used to snap back to the first item). Keyboard nav / typeahead take the highlight back
|
||||
by nulling hoverIndex in onNavigate/onMatch above. */}
|
||||
{children}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -14,6 +14,13 @@ export interface ReleaseEntry {
|
||||
}
|
||||
|
||||
export const RELEASE_NOTES: ReleaseEntry[] = [
|
||||
{
|
||||
version: "0.60.3",
|
||||
date: "2026-08-08",
|
||||
fixes: [
|
||||
"In a menu, the highlight now stays on the row you last hovered when you move the pointer off it, instead of snapping back to the first item.",
|
||||
],
|
||||
},
|
||||
{
|
||||
version: "0.60.2",
|
||||
date: "2026-08-08",
|
||||
|
||||
Reference in New Issue
Block a user