fix: Prevent context menu from closing prematurely on mouse movement and hover interactions #1

Merged
jess merged 2 commits from pxlman/Acord:main into main 2026-05-06 02:06:58 +00:00
Contributor

Problem

The context menu would disappear immediately after opening or when the user moved the mouse to interact with menu items. This was caused by overly aggressive menu dismissal logic that closed the menu on any message except ShowContextMenu.

Root Cause

The preserve_context_menu flag only preserved the menu for ShowContextMenu messages, causing:

  • CursorMove events (mouse movement) to close the menu instantly
  • TableMsg::CellEnter events (hovering over menu items) to close the menu
  • The menu to be unusable in practice

Solution

Updated the menu preservation logic to keep the menu open for all interaction messages that occur while the menu is active:

let preserve_context_menu = matches!(
    &message,
    Message::ShowContextMenu { .. }      // Opening the menu
    | Message::TableMsg(_, TableMessage::CursorMove(_,_)) 
    | Message::TableMsg(_, TableMessage::CellEnter(_,_))
    | Message::HideContextMenu           // Explicit close action
);
## Problem The context menu would disappear immediately after opening or when the user moved the mouse to interact with menu items. This was caused by overly aggressive menu dismissal logic that closed the menu on **any** message except `ShowContextMenu`. ## Root Cause The `preserve_context_menu` flag only preserved the menu for `ShowContextMenu` messages, causing: - `CursorMove` events (mouse movement) to close the menu instantly - `TableMsg::CellEnter` events (hovering over menu items) to close the menu - The menu to be unusable in practice ## Solution Updated the menu preservation logic to keep the menu open for all interaction messages that occur while the menu is active: ```rust let preserve_context_menu = matches!( &message, Message::ShowContextMenu { .. } // Opening the menu | Message::TableMsg(_, TableMessage::CursorMove(_,_)) | Message::TableMsg(_, TableMessage::CellEnter(_,_)) | Message::HideContextMenu // Explicit close action ); ```
pxlman added 2 commits 2026-05-06 01:17:45 +00:00
jess merged commit 15415db1af into main 2026-05-06 02:06:58 +00:00
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: jess/Acord#1
No description provided.