Skip to content

input: Add context_menu option to support disable ContextMenu.#1770

Closed
pedrobartolini wants to merge 2 commits intolongbridge:mainfrom
pedrobartolini:input-optional-rclick-menu
Closed

input: Add context_menu option to support disable ContextMenu.#1770
pedrobartolini wants to merge 2 commits intolongbridge:mainfrom
pedrobartolini:input-optional-rclick-menu

Conversation

@pedrobartolini
Copy link
Copy Markdown

@pedrobartolini pedrobartolini commented Dec 9, 2025

Description

Popovers already use defer_draw to render above other content, thus right-clicking an input inside a popover (triggering a context menu which also uses defer_draw), you get nested deferred drawing → panic.

This small change allows users to disable the menu, making it safe to right-click inputs inside popovers.

How to Test

InputState::new(window, cx)
   .default_value(format!("{}/{}", config.ipv4, config.ipv4_prefix))
   .placeholder("IPv4")
   .context_menu(false)  // disables ContextMenu input is now safe to use inside popovers

…tion menu

Popovers already use defer_draw to render above other content, and when you right-click an input inside a popover (triggering a context menu which also uses defer_draw), you get nested deferred drawing → panic.

This option allows users to safely right-click inputs inside popovers.
@huacnlee
Copy link
Copy Markdown
Member

huacnlee commented Dec 9, 2025

This not the best way to solve issue, let me think about.

Ref zed-industries/zed#42765

@huacnlee huacnlee changed the title input panic fix: toggleable right-click action menu input: Add context_menu option to support disable ContextMenu. Dec 22, 2025
@huacnlee
Copy link
Copy Markdown
Member

huacnlee commented Feb 6, 2026

Close this by zed-industries/zed#47770

@huacnlee huacnlee closed this Feb 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants