Skip to content

Commit 06db0be

Browse files
morgmartCarl
authored andcommitted
Preserve composer focus handoff with the modal guard
Co-authored-by: Carl <[email protected]> Signed-off-by: morgmart <[email protected]>
1 parent fa3b544 commit 06db0be

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

‎src/features/panels/PanelWorkspace.tsx‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,14 @@ export function PanelWorkspace({
193193
const tab = root.current?.querySelector<HTMLElement>(
194194
'[role="tab"][aria-selected="true"]',
195195
);
196+
const content =
197+
focusContent.current && previous.current !== selected
198+
? document
199+
.getElementById(panelId(selected))
200+
?.querySelector<HTMLElement>(
201+
'[data-tab-focus]:not([aria-disabled="true"])',
202+
)
203+
: undefined;
196204
// A route may mount/select a retained tab behind an open dialog.
197205
// Its navigation must not take focus from the modal's own handoff.
198206
const modal = document.querySelector('dialog[open], [aria-modal="true"]');

0 commit comments

Comments
 (0)