Skip to content

input: Run the context menu handler with the input released - #3434

Closed
cesartalen wants to merge 1 commit into
longbridge:mainfrom
cesartalen:fix-input-context-menu-reentry
Closed

cesartalen wants to merge 1 commit into
longbridge:mainfrom
cesartalen:fix-input-context-menu-reentry

Conversation

@cesartalen

Copy link
Copy Markdown

Closes #3427

Description

A custom Input/Textarea context_menu builder ran inside the input's own update, so reading the input from it (cursor, selection) panicked and aborted the app. The handler now runs with the input released; focus bookkeeping happens in a separate update afterwards. No public API changes.

How to Test

  • cargo test -p gpui-base context_menu_handler_is_deferred_and_respects_disabled
    — the handler updates its own input; panics without the fix.
  • cargo test -p gpui-kit --features test-support,component --test menu
    — context menu focus and selection on inputs are unchanged.

Checklist

  • I have read the CONTRIBUTING document and followed the guidelines.
  • Reviewed the changes in this PR and confirmed AI generated code (If any) is accurate.
  • Passed cargo run for story tests related to the changes.
  • Tested macOS, Windows and Linux platforms performance (if the change is platform-specific)

@huacnlee huacnlee changed the title fix(input): run the context menu handler with the input released input: Run the context menu handler with the input released Oct 11, 2026
@huacnlee

huacnlee commented Oct 11, 2026 •

Copy link
Copy Markdown
Member

Thanks for the fix, @cesartalen! #3433 opened a few minutes earlier with the same change for #3427, plus a dedicated test that reads the input from the handler, so we're going with that one and closing this as a duplicate. Your approach was correct, and we appreciate the contribution.

@huacnlee huacnlee closed this Oct 11, 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.

Input/Textarea: custom context_menu builder runs while the input state is being updated — reading the input there panics and aborts the app

2 participants