Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(popover): make the close button the first focus always #1720

Merged
merged 2 commits into from
Aug 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/wise-days-smash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@twilio-paste/popover': patch
'@twilio-paste/core': patch
---

The Popover's close button will now always be the first focus upon opening.
2 changes: 1 addition & 1 deletion packages/paste-core/components/popover/src/Popover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ const Popover = React.forwardRef<HTMLDivElement, PopoverProps>(({children, ...pr
<StyledBase>
<PopoverArrow {...(popover as any)} />
<Box paddingX="space80" paddingY="space70">
{children}
<Box position="absolute" right={8} top={8}>
<Button
variant="reset"
Expand All @@ -55,6 +54,7 @@ const Popover = React.forwardRef<HTMLDivElement, PopoverProps>(({children, ...pr
<CloseIcon decorative={false} color="colorTextWeak" size="sizeIcon10" title="Close popover" />
</Button>
</Box>
{children}
</Box>
</StyledBase>
</NonModalDialogPrimitive>
Expand Down