Skip to content

Commit

Permalink
fix: share popover a11y (#214)
Browse files Browse the repository at this point in the history
  • Loading branch information
PahaN47 authored Sep 11, 2024
1 parent b6cf521 commit 262cab8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/components/SharePopover/SharePopover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -156,11 +156,12 @@ export const SharePopover = (props: SharePopoverProps) => {
[onClick, text, title, url, useWebShareApi],
);

const shouldOpenByHover = openByHover && !useWebShareApi;
return (
<Popover
placement={placement}
hasArrow={false}
openOnHover={openByHover && !useWebShareApi}
openOnHover={shouldOpenByHover}
autoclosable={autoclosable}
delayClosing={closeDelay}
content={content}
Expand All @@ -171,6 +172,8 @@ export const SharePopover = (props: SharePopoverProps) => {
tooltipId={tooltipId}
disablePortal
onOpenChange={setIsOpen}
focusTrap={!shouldOpenByHover}
autoFocus={!shouldOpenByHover}
>
{({onClick: onClickInner}) => (
<button
Expand Down

0 comments on commit 262cab8

Please sign in to comment.