Skip to content

fix(chromium-headful): refocus live view on mouse down - #337

Open
masnwilliams wants to merge 1 commit into
mainfrom
hypeship/focus-live-view-on-click
Open

fix(chromium-headful): refocus live view on mouse down#337
masnwilliams wants to merge 1 commit into
mainfrom
hypeship/focus-live-view-on-click

Conversation

@masnwilliams

@masnwilliams masnwilliams commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

summary

  • restore keyboard focus to the live-view overlay on desktop mouse down
  • keep the existing host, lock, and touch-device guards

why

The overlay prevents the browser's default mouse-down behavior. If focus moves elsewhere while the pointer remains over the video, mouseenter does not fire again and clicking the video cannot restore focus. Subsequent keyboard events are delivered to the previously focused control instead of the remote browser.

validation

  • ran a same-session full-stack A/B three times with trusted mouse and keyboard input
    • stock: focus remained on the external control and the remote field stayed empty
    • patched: focus returned to textarea.overlay and the remote field received abc
  • verified remote mousedown, mouseup, and click delivery still works
  • verified Shift, printable keys, Backspace, and Enter produced the exact remote value Abc1\n
  • bun run lint (0 errors; existing warnings)
  • bun run build (passes; existing lint and bundle-size warnings)

The client does not currently have an automated component test suite for this interaction.


Note

Low Risk
Single guarded focus call in the live-view mouse handler; no auth, data, or API changes.

Overview
Fixes desktop live-view keyboard capture when focus has drifted off the overlay while the pointer is still over the video.

After the existing hosting and lock checks in onMouseDown, non-touch sessions now call focus() on the overlay textarea before forwarding mouse position and remote mousedown. Touch devices are unchanged so mobile keyboard behavior stays the same.

This addresses a case where mouseenter does not run again after focus moves elsewhere, so clicks on the video did not restore focus and keystrokes went to the wrong control.

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

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.

1 participant