Skip to content

Commit 09f07e5

Browse files
authored
fix: Prevent incorrect dashboard side panel close (#1372)
Closes #1324 Closes HDX-2724 This PR fixes a bug that caused the Side Panel to close when clicked when on a dashboard with more than one Search Table tile. The fix was to remove the `useClickOutside` hook in favor of Mantine's default behavior, which is to close when clicking outside the drawer.
1 parent 4d1eaf1 commit 09f07e5

File tree

2 files changed

+6
-12
lines changed

2 files changed

+6
-12
lines changed

.changeset/ninety-baboons-shop.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@hyperdx/app": patch
3+
---
4+
5+
fix: Prevent incorrect dashboard side panel close

packages/app/src/components/DBRowSidePanel.tsx

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import { useHotkeys } from 'react-hotkeys-hook';
1515
import { TSource } from '@hyperdx/common-utils/dist/types';
1616
import { ChartConfigWithDateRange } from '@hyperdx/common-utils/dist/types';
1717
import { Box, Drawer, Flex, Stack } from '@mantine/core';
18-
import { useClickOutside } from '@mantine/hooks';
1918

2019
import DBRowSidePanelHeader, {
2120
BreadcrumbNavigationCallback,
@@ -527,12 +526,6 @@ export default function DBRowSidePanelErrorBoundary({
527526

528527
useHotkeys(['esc'], _onClose, { enabled: subDrawerOpen === false });
529528

530-
const drawerRef = useClickOutside(() => {
531-
if (!subDrawerOpen && !isChildModalOpen && rowId != null) {
532-
_onClose();
533-
}
534-
}, ['mouseup', 'touchend']);
535-
536529
return (
537530
<Drawer
538531
opened={rowId != null}
@@ -554,11 +547,7 @@ export default function DBRowSidePanelErrorBoundary({
554547
zIndex={drawerZIndex}
555548
>
556549
<ZIndexContext.Provider value={drawerZIndex}>
557-
<div
558-
className={styles.panel}
559-
ref={drawerRef}
560-
data-testid="row-side-panel"
561-
>
550+
<div className={styles.panel} data-testid="row-side-panel">
562551
<Box className={styles.panelDragBar} onMouseDown={startResize} />
563552
<ErrorBoundary
564553
fallbackRender={error => (

0 commit comments

Comments
 (0)