Skip to content

Commit c44aaf2

Browse files
authored
fix(DoDontBlock): close alt text flyout on deselect (#1260)
1 parent 1f9967c commit c44aaf2

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

packages/shared/src/components/EditAltTextFlyout/EditAltTextFlyout.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,17 @@ export const EditAltTextFlyout = ({
5757
onSave,
5858
localAltText,
5959
}: EditAltTextFlyoutProps) => (
60-
<Flyout.Root open={showAltTextMenu}>
60+
<Flyout.Root open={showAltTextMenu} onOpenChange={setShowAltTextMenu}>
6161
<Flyout.Trigger>
6262
<div className="tw-absolute tw-top-0 tw-right-6" />
6363
</Flyout.Trigger>
64-
<Flyout.Content side="bottom" align="start" padding="comfortable" maxWidth="320px">
64+
<Flyout.Content
65+
side="bottom"
66+
align="start"
67+
padding="comfortable"
68+
maxWidth="320px"
69+
{...{ onFocusOutside: (event: Event) => event.preventDefault() }}
70+
>
6571
<Flyout.Body>
6672
<EditAltTextFlyoutScreen setLocalAltText={setLocalAltText} localAltText={localAltText} />
6773
</Flyout.Body>

0 commit comments

Comments
 (0)