diff --git a/src/components/SharePopover/SharePopover.tsx b/src/components/SharePopover/SharePopover.tsx index 4883486..79970a8 100644 --- a/src/components/SharePopover/SharePopover.tsx +++ b/src/components/SharePopover/SharePopover.tsx @@ -108,6 +108,7 @@ export const SharePopover = (props: SharePopoverProps) => { buttonAriaLabel, } = props; const [isOpen, setIsOpen] = React.useState(false); + const buttonRef = React.useRef(null); const tooltipId = useUniqId(); const content = React.useMemo( @@ -174,6 +175,7 @@ export const SharePopover = (props: SharePopoverProps) => { onOpenChange={setIsOpen} focusTrap={!shouldOpenByHover} autoFocus={!shouldOpenByHover} + restoreFocusRef={shouldOpenByHover ? undefined : buttonRef} > {({onClick: onClickInner}) => (