Keep copy tooltips closed when a dialog opens 🤫📋

Merged
WO
12d ago
+39-1

Summary

  • Focus the dialog itself on open so the copy button tooltip stays hidden until the button receives focus.
  • Add a regression test for the dialog’s initial focus.

Testing

  • pnpm vitest run: 630 tests passed.
  • pnpm tsc --noEmit: passed.
  • ESLint and Prettier checks for the changed files: passed.

Summary by cubic

Focuses the dialog container itself on open instead of its first interactive control, so the copy button tooltip no longer appears while the dialog is still animating in.

  • Adds an onOpenAutoFocus handler that skips default autofocus and focuses the dialog element without scrolling.
  • Adds the outline-hidden class to the dialog content.
  • Adds a regression test asserting the dialog receives initial focus.