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
- 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-repro using CaesarConverter.
- Reopen New Converter, select
CaesarConverter, reuse focus-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, commit 6fd719317c09228cb332cacf5d76b6602610b591
- Python package inventory: N/A; this is a frontend focus-management defect.
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-340Steps/Code to Reproduce
document.activeElement. It is<body>instead of the opening button.focus-reprousingCaesarConverter.CaesarConverter, reusefocus-repro, and submit.<body>, outside the visible dialog, and Escape does not dismiss it.<body>.<body>after the row disappears.Expected Results
Actual Results
<body>.<body>while the dialog remains open.<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.activeElementresult is included above.Versions
1.2.0.dev0, commit6fd719317c09228cb332cacf5d76b6602610b591