Web UI: terminal scroll buttons no longer steal xterm focus#280
Merged
Conversation
The top/bottom terminal scroll buttons called `state.term.focus()` after scrolling, which focuses xterm's helper textarea and summons the mobile soft keyboard whenever you tapped them just to read scrollback. Drop the `focus()` calls, and `preventDefault` the buttons' `mousedown` so they don't take focus themselves either. Scrolling now leaves xterm's focus state untouched — focused stays focused, unfocused stays unfocused — so no keyboard pops up while reading scrollback. The existing `stopPropagation` already blocks the terminal's tap-to-focus handler, so there's no secondary focus path. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Update the assertion to match the fix in this branch: the terminal top/bottom scroll buttons no longer call term.focus() (which summoned the mobile soft keyboard), so the expected call sequence is now ["top", "bottom"] instead of ["top", "focus", "bottom", "focus"]. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Problem
The terminal top / bottom scroll buttons called
state.term.focus()after scrolling (initTerminalScrollButtons,index.html). On mobile, focusing xterm focuses its helper textarea, which summons the soft keyboard — so tapping a scroll button just to read scrollback popped the keyboard up over the content.Fix
state.term.focus()from both the top and bottom click handlers.preventDefaultthe buttons'mousedownso the button doesn't grab focus from xterm on press either.Net effect: the scroll buttons only scroll and leave xterm's focus state exactly as it was — focused stays focused, unfocused stays unfocused — so no keyboard appears while scrolling. The existing
stop(ev)(stopPropagation) already prevents the click from reaching the terminal's tap-to-focus handler, so there's no secondary focus path. Intentionally tapping the terminal body still focuses it / raises the keyboard as before.Test
Verified on mobile: top/bottom scroll with the keyboard staying down; tapping the terminal body still focuses it.
🤖 Generated with Claude Code