fix(app): stop keyboard events at native level in inline editors#20
Open
devin-ai-integration[bot] wants to merge 1 commit into
Open
fix(app): stop keyboard events at native level in inline editors#20devin-ai-integration[bot] wants to merge 1 commit into
devin-ai-integration[bot] wants to merge 1 commit into
Conversation
SolidJS event delegation attaches handlers at the document level, so calling stopPropagation inside a delegated onKeyDown fires too late — the native event has already bubbled through parent interactive elements (buttons, Collapsible triggers, Tabs list). This allows the browser to treat Space as a button activation key, toggling collapsibles or switching tabs instead of typing a space character. Switch all inline-editing inputs to native addEventListener via the ref callback. The native handler fires during the element's own event phase so stopPropagation prevents the event from ever reaching parent nodes. Also stop keyup propagation to block the second half of the browser's Space-to-click mechanism on buttons. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue for this PR
Closes anomalyco#2559
Type of change
What does this PR do?
Pressing Space while renaming (workspace, project, session title, terminal tab) triggers parent interactive elements instead of typing a space character.
Root cause: SolidJS delegates
onKeyDown/onKeyUpto the document level viadocument.addEventListener. By the timeevent.stopPropagation()runs inside the delegated handler, the native DOM event has already bubbled through parent buttons,Collapsible.Triggers, andTabs.List— so the browser's built-in Space→click activation fires on those parents.Fix: Switch all three inline-editing inputs from SolidJS-delegated
onKeyDownto nativeaddEventListenervia therefcallback. The native listener fires during the element's own event phase, sostopPropagation()prevents the event from ever reaching parent nodes.keyupis also stopped to block the second half of the browser's Space-to-click mechanism on buttons.Files changed:
packages/app/src/pages/layout/inline-editor.tsx— sharedInlineEditorused by workspace/project renamepackages/app/src/pages/session/message-timeline.tsx— session title renamepackages/app/src/components/session/session-sortable-terminal-tab.tsx— terminal tab rename (was also missingstopPropagationentirely)How did you verify your code works?
bun lint) passes — no warnings in changed filesbun typecheckvia tsgo) passes across all 23 packagesScreenshots / recordings
N/A — keyboard event handling change, no visual diff.
Checklist
Link to Devin session: https://ogp.devinenterprise.com/sessions/b057240acb4f4ca981b2e5027e173121