Summary
On a multi-line Input, opening a framework-rendered context menu (the
generic ContextMenuExt::context_menu PopupMenu, e.g. a custom right-click
menu attached to the input) makes the selected-text highlight disappear
until the menu closes. The user then can't see what Cut / Copy / Select All
will apply to.
Current behavior
ContextMenuExt::context_menu(PopupMenu) takes focus while open:build_menucallsfocus_handle.focus(window, cx).layout_selections()incrates/base/src/input/base/element.rsearly-returns when the input is not focused:if !state.focus_handle.is_focused(window) { return vec![]; }- So while the menu is open the selection path is never produced and no highlight is painted. It comes back immediately after dismiss.
Note: the same disappearance also happens with the input's own built-in
menus (completion / code actions), because layout_selections is gated
only on focus and never consults is_context_menu_open. The OS-native
right-click menu (handle_right_click_menu → NativeMenu) keeps the
highlight, because it never takes focus away.
Steps to reproduce
- Multi-line
Input(plain multi-line orInputMode::CodeEditor). - Select a range of text.
- Open a context menu over the input — either the generic
ContextMenuExt::context_menuPopupMenu (right-click) or one of the built-in menus (completion / code actions). - While the menu is open the selection highlight is gone; it returns on dismiss.
Environment
- GPUI Component: 0.5.2 (rev 88f102d) and current main (caf830c0, gpui-kit / gpui-base layout) — both reproduce
- Platform: Windows 11
Expected
The selected-text highlight stays visible while a context menu is open, so the user can confirm which text the menu actions will affect (matching the native-menu behavior).
I can confirm this issue on Linux as well.