Skip to content

FIX: restore keyboard focus to launch button on preview dismissal (#2680) - #2686

Merged
Roman Lutz (romanlutz) merged 3 commits into
microsoft:mainfrom
ManoharPaturi:fix/scanner-preview-focus-restore
Sep 22, 2026
Merged

Roman Lutz (romanlutz) merged 3 commits into
microsoft:mainfrom
ManoharPaturi:fix/scanner-preview-focus-restore

Conversation

@ManoharPaturi

Copy link
Copy Markdown
Contributor

Description

Fixes #2680.

Dismissing Scanner's Run preview dialog via either the Cancel button or Escape key left document.activeElement on <body> rather than returning focus to the Launch scan button that opened the dialog.

This change:

  1. Retains a ref to the Launch scan button (launchButtonRef).
  2. Restores focus to the Launch scan button on non-submitting dismissal paths (onOpenChange when closing, and the Cancel button handler).
  3. Adds automated regression tests in ScenarioDetail.test.tsx covering focus restoration for both Cancel and Escape dismissal paths.

Validation

  • npm test -- ScenarioDetail.test.tsx (43/43 tests pass)
  • npm run type-check passes
  • npm run lint passes with 0 warnings
  • Signed-off with DCO

…missal (microsoft#2680)

Signed-off-by: Manohar Paturi <186662190+ManoharPaturi@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings September 17, 2026 07:12

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@romanlutz Roman Lutz (romanlutz) changed the title fix(frontend): restore keyboard focus to launch button on preview dismissal (#2680) FIX: restore keyboard focus to launch button on preview dismissal (#2680) Sep 21, 2026
@romanlutz
Roman Lutz (romanlutz) added this pull request to the merge queue Sep 22, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Sep 22, 2026
@romanlutz
Roman Lutz (romanlutz) added this pull request to the merge queue Sep 22, 2026
Merged via the queue into microsoft:main with commit 5f8361a Sep 22, 2026
41 checks passed
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.

Scanner run preview dismissal does not restore keyboard focus

3 participants