Skip to content

Commit b8f783f

Browse files
committed
Revert "Blur trigger when closing popover"
This reverts part of commit 6d19bbe.
1 parent 03f93b8 commit b8f783f

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

packages/compass-components/src/components/interactive-popover.tsx

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ type InteractivePopoverProps = {
6060
containedElements?: string[];
6161
containerClassName?: string;
6262
closeButtonClassName?: string;
63-
blurTriggerOnClose?: boolean;
6463
} & Pick<
6564
React.ComponentProps<typeof Popover>,
6665
'align' | 'justify' | 'spacing' | 'popoverZIndex'
@@ -81,7 +80,6 @@ function InteractivePopover({
8180
popoverZIndex,
8281
containerClassName,
8382
closeButtonClassName,
84-
blurTriggerOnClose = false,
8583
}: InteractivePopoverProps): React.ReactElement {
8684
const darkMode = useDarkMode();
8785
const triggerRef = useRef<HTMLButtonElement>(null);
@@ -93,13 +91,9 @@ function InteractivePopover({
9391

9492
// Return focus to the trigger when the popover is hidden.
9593
setTimeout(() => {
96-
if (blurTriggerOnClose) {
97-
triggerRef.current?.blur();
98-
} else {
99-
triggerRef.current?.focus();
100-
}
94+
triggerRef.current?.focus();
10195
});
102-
}, [setOpen, blurTriggerOnClose]);
96+
}, [setOpen]);
10397

10498
const onClickTrigger = useCallback(
10599
(event) => {

packages/compass-sidebar/src/components/connections-filter-popover.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ export default function ConnectionsFilterPopover({
7171
<InteractivePopover
7272
open={open}
7373
setOpen={setOpen}
74-
blurTriggerOnClose
7574
containerClassName={containerStyles}
7675
hideCloseButton
7776
trigger={({ onClick, children, ref }) => (

0 commit comments

Comments
 (0)