Skip to content

Remove disableAutoFocus in favor of focusOnHover={false}#717

Open
victorjzq wants to merge 1 commit intotscircuit:mainfrom
victorjzq:fix/issue-163
Open

Remove disableAutoFocus in favor of focusOnHover={false}#717
victorjzq wants to merge 1 commit intotscircuit:mainfrom
victorjzq:fix/issue-163

Conversation

@victorjzq
Copy link
Copy Markdown

/claim #163

Summary

  • Replaced disableAutoFocus with focusOnHover prop (default: false) in PCBViewer, CanvasElementsRenderer, and DimensionOverlay
  • focusOnHover={false} (default) prevents the viewer from stealing page focus on mouse enter — equivalent to the old disableAutoFocus behavior
  • focusOnHover={true} opts into focus-on-hover for keyboard shortcut support without clicking first
  • Added hover-behavior.fixture.tsx story demonstrating both modes
  • Updated README to document the focusOnHover and clickToInteractEnabled props

Test plan

  • Verify PCBViewer no longer steals focus from other page elements (e.g. textarea) by default
  • Verify focusOnHover={true} enables keyboard shortcuts (e.g. zoom hotkeys) when hovering without clicking
  • Verify focusOnHover={false} (default) preserves textarea input when PCBViewer is on the same page
  • Check hover-behavior.fixture.tsx stories render correctly in Storybook

Replace disableAutoFocus in favor of focusOnHover={false} — the prop
defaults to false so focus is not stolen from the page on hover, and
users can opt in to focus-on-hover behavior by passing focusOnHover={true}.
@vercel
Copy link
Copy Markdown

vercel bot commented Mar 19, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
pcb-viewer Ready Ready Preview, Comment Mar 19, 2026 0:58am

Request Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant