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:
2026-08-08 23:33:39 +02:00
parent 3387352117
commit 62a3d1034b
3 changed files with 14 additions and 7 deletions
+1 -1
View File
@@ -1 +1 @@
0.60.2
0.60.3
+6 -6
View File
@@ -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>
+7
View File
@@ -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",