microsoft / microsoft/PyRIT

BUG Converter Registry dialogs lose keyboard focus after dismissal and duplicate errors

Open
#2,701 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Bug: triage help wanted
Dominant language
Python
Stars
4.5k
Forks
893
Avg merge
3d 50m
Merged PRs (30d)
165

Description

Describe the bug

The Converter Registry's Add and Remove dialogs do not restore keyboard focus after they close. The duplicate-name error path is more disruptive: when the API error appears, focus moves outside the still-open modal to <body>, and Escape no longer dismisses the dialog.

This was reproduced on commit 6fd719317c09228cb332cacf5d76b6602610b591. Fresh searches across open issues and pull requests found no matching report.

Relevant source:

  • frontend/src/components/Registry/ConverterRegistry.tsx:129-150,203-228
  • frontend/src/components/Registry/CreateConverterDialog.tsx:285-340
Steps/Code to Reproduce
  1. Open Registry > Converters.
  2. Activate New Converter, then activate Cancel.
  3. Inspect document.activeElement. It is <body> instead of the opening button.
  4. Create a converter named focus-repro using CaesarConverter.
  5. Reopen New Converter, select CaesarConverter, reuse focus-repro, and submit.
  6. After the duplicate-name error appears, inspect focus and press Escape.
  7. Observe that focus is on <body>, outside the visible dialog, and Escape does not dismiss it.
  8. Open Remove focus-repro and dismiss with Escape or Cancel. Focus again lands on <body>.
  9. Reopen Remove and confirm removal. Focus still lands on <body> after the row disappears.
const activeElement = {
  tag: document.activeElement?.tagName,
  insideDialog: Boolean(document.activeElement?.closest('[role="dialog"]')),
};
// Actual after each affected path:
// { tag: 'BODY', insideDialog: false }
Expected Results
  • Closing Add should return focus to New Converter or Create First Converter.
  • Closing Remove should return focus to the row's Remove button, or to a stable nearby control after successful removal.
  • When submission fails, focus should remain inside the modal, preferably on the error or invalid field.
  • Escape should continue to dismiss the visible modal after an API error.
Actual Results
  • Add Cancel leaves focus on <body>.
  • A duplicate-name response leaves focus on <body> while the dialog remains open.
  • Escape does not dismiss the dialog after focus escapes on the duplicate-error path.
  • Remove Cancel, Escape, and successful confirmation leave focus on <body>.

Keyboard users lose their place after routine actions and must tab back through the interface. No entered data is lost.

Screenshots

N/A. The defect is the active focus state; the deterministic document.activeElement result is included above.

Versions
  • OS: Windows
  • Browser: Chromium through Playwright 1.63.0
  • Node: 25.7.0
  • Python: 3.14.4
  • PyRIT: 1.2.0.dev0, commit 6fd719317c09228cb332cacf5d76b6602610b591
  • Python package inventory: N/A; this is a frontend focus-management defect.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the focus paths with Playwright, then inspect frontend/src/components/Registry/ConverterRegistry.tsx lines 129-150 and 203-228 and CreateConverterDialog.tsx lines 285-340. Verify each dismissal path and the duplicate-name error path against document.activeElement. Done means focus returns to the triggering or stable control, remains inside the open dialog on error, and Escape still dismisses it.

Written by the indexing model from the issue text.

Assessment

Tech stack
playwright, typescript
Domain
accessibility, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
75/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.