web: restore focus to a row's real control
The a11y work made the chat row a container with its control inside, so Back focused a non-focusable div and keyboard focus fell to the body. Focus the first focusable descendant instead (generic for chat, runs, pipelines and templates).
This commit is contained in:
+6
-1
@@ -842,7 +842,12 @@ function restoreListFocus(restore) {
|
||||
)
|
||||
: null;
|
||||
if (row) {
|
||||
row.focus();
|
||||
// A row may be a plain container whose real control is a child button (the
|
||||
// a11y work moved the chat session's control inside the row), so focus the
|
||||
// first focusable descendant rather than a non-focusable div.
|
||||
const target =
|
||||
row.matches("button, a, [tabindex]") ? row : row.querySelector("button, a, [tabindex]") ?? row;
|
||||
target.focus();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user