BUG Converter Registry dialogs lose keyboard focus after dismissal and duplicate errors
Nobody has claimed this yet.
- 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-228frontend/src/components/Registry/CreateConverterDialog.tsx:285-340
Steps/Code to Reproduce
- Open Registry > Converters.
- Activate New Converter, then activate Cancel.
- Inspect
document.activeElement. It is<body>instead of the opening button. - Create a converter named
focus-reprousingCaesarConverter. - Reopen New Converter, select
CaesarConverter, reusefocus-repro, and submit. - After the duplicate-name error appears, inspect focus and press Escape.
- Observe that focus is on
<body>, outside the visible dialog, and Escape does not dismiss it. - Open Remove focus-repro and dismiss with Escape or Cancel. Focus again lands on
<body>. - 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, commit6fd719317c09228cb332cacf5d76b6602610b591 - Python package inventory: N/A; this is a frontend focus-management defect.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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