Skip to content

fix: prevent inline toolbar from closing when clicking on form controls inside it - #3017

Open
waterWang wants to merge 1 commit into
codex-team:nextfrom
waterWang:fix/popover-form-control
Open

fix: prevent inline toolbar from closing when clicking on form controls inside it#3017
waterWang wants to merge 1 commit into
codex-team:nextfrom
waterWang:fix/popover-form-control

Conversation

@waterWang

@waterWang waterWang commented Aug 11, 2026

Copy link
Copy Markdown

Description

Fixes #2985

When clicking on a form control (e.g. or ) inside the Inline Toolbar popover, the selection is lost, which triggers a selectionchange event. The selectionChanged handler was unconditionally closing the Inline Toolbar when there is no selection range, even if the user is interacting with a form control inside the toolbar.

Changes

  • In ui.ts selectionChanged() : before closing the Inline Toolbar when there is no selection range, check if document.activeElement is inside the Inline Toolbar. If the user is focused on a form control inside the toolbar, keep it open.

…ls inside it

When clicking on a form control (e.g. <select> or <input>) inside the
Inline Toolbar popover, the selection is lost, which triggers a
selectionchange event. The selectionChanged handler was unconditionally
closing the Inline Toolbar when there is no selection range, even if
the user is interacting with a form control inside the toolbar.

Fix: check if the active element is inside the Inline Toolbar before
closing it. If the user is focused on a form control inside the toolbar,
keep it open.

Fixes codex-team#2985
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.

Popover closes when clicking on select when input is focused

1 participant