Skip to content

[codex] fix: keep settings Escape local to edit fields#3534

Open
StiensWout wants to merge 3 commits into
pingdotgg:mainfrom
StiensWout:staging/settings-escape-editable-guard
Open

[codex] fix: keep settings Escape local to edit fields#3534
StiensWout wants to merge 3 commits into
pingdotgg:mainfrom
StiensWout:staging/settings-escape-editable-guard

Conversation

@StiensWout

@StiensWout StiensWout commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add a composed-path editable target guard to the settings Escape handler.
  • Treat native edit fields, contenteditable textboxes, and the shared SelectTrigger as local Escape owners.
  • Preserve settings back navigation when focus is outside editable controls.

Root cause

The settings route window keydown handler handled every unprevented Escape before checking whether the event came from an editable control.

Impact

Escape no longer leaves settings edit fields or closes a Base UI select trigger unexpectedly. Non-editable focus still uses the existing settings back navigation.

Validation

  • PATH="$HOME/.vite-plus/bin:$PATH" vp check
  • PATH="$HOME/.vite-plus/bin:$PATH" vp run typecheck

Note

Low Risk
Localized keyboard routing in the settings route only; no auth, data, or API changes.

Overview
Escape in settings no longer navigates away when the key is pressed while focus is inside an editable control.

SettingsContentLayout’s window-level Escape handler now bails out if the event’s composed path includes native inputs, textareas, selects, [data-slot="select-trigger"] (shared UI select), contenteditable regions, or role="textbox". A small eventPathContainsSelector helper walks event.composedPath() (with a event.target fallback) to detect those targets. Back navigation on Escape is unchanged when focus is outside those elements.

Reviewed by Cursor Bugbot for commit a0f1ff3. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Fix Escape key in settings to skip navigation when focus is within editable fields

The SettingsContentLayout keydown handler in settings.tsx previously navigated back on every Escape keypress. It now checks whether the event originated from an input, textarea, select, contenteditable, or role="textbox" element and skips navigation if so, using a new eventPathContainsSelector utility that walks event.composedPath().

Macroscope summarized a0f1ff3.

@coderabbitai

coderabbitai Bot commented Jun 23, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: bf3d4954-36c6-4a48-9ea9-e7fb092a1bb7

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added size:S 10-29 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list. labels Jun 23, 2026
@macroscopeapp

macroscopeapp Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved

Small, self-contained bug fix that prevents the Escape key from navigating away when typing in editable fields. The change adds a straightforward guard condition with clear intent and no side effects.

You can customize Macroscope's approvability policy. Learn more.

StiensWout and others added 3 commits June 23, 2026 20:17
Co-authored-by: Codex <codex@openai.com>
Co-authored-by: Codex <codex@openai.com>
…able-guard

[codex] fix: keep settings Escape local to edit fields
@StiensWout StiensWout force-pushed the staging/settings-escape-editable-guard branch from 629ae00 to a0f1ff3 Compare June 23, 2026 20:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S 10-29 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant