Skip to content

Commit 9d0437b

Browse files
authored
fix: closing expand dialog returns focus to expand button (#3710)
1 parent 526a15f commit 9d0437b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/app/views/query-response/QueryResponse.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ import {
77
DialogTrigger,
88
makeStyles,
99
tokens,
10-
Tooltip
10+
Tooltip,
11+
useRestoreFocusTarget
1112
} from '@fluentui/react-components';
1213
import { DismissRegular, ExpandUpLeftRegular } from '@fluentui/react-icons';
1314
import { useState } from 'react';
@@ -44,6 +45,8 @@ const useStyles = makeStyles({
4445
const PivotItemsDialog = () => {
4546
const [open, setOpen] = useState(false);
4647
const styles = useStyles();
48+
const restoreFocusTargetAttribute = useRestoreFocusTarget();
49+
4750

4851
return (
4952
<div>
@@ -53,6 +56,7 @@ const PivotItemsDialog = () => {
5356
icon={<ExpandUpLeftRegular />}
5457
aria-label={translateMessage('Expand')}
5558
className={styles.dialogBtn}
59+
{...restoreFocusTargetAttribute}
5660
onClick={() => setOpen(true)}
5761
/>
5862
</Tooltip>

0 commit comments

Comments
 (0)