Skip to content

Commit 80ec773

Browse files
Copilotcopilot-swe-agent[bot]mfranzke
authored
fix: DBTooltip race condition when component unmounts during delayed positioning (#4984)
* Initial plan * fix: db-tooltip race condition with null check in delayed callback * Update tooltip.lite.tsx --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: Maximilian Franzke <[email protected]>
1 parent dfa9e20 commit 80ec773

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

packages/components/src/components/tooltip/tooltip.lite.tsx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,14 @@ export default function DBTooltip(props: DBTooltipProps) {
5656
if (_ref) {
5757
// This is a workaround for angular
5858
utilsDelay(() => {
59-
handleFixedPopover(
60-
_ref,
61-
parent,
62-
(props.placement as unknown as string) ?? 'bottom'
63-
);
59+
// Due to race conditions we need to check for _ref again
60+
if (_ref) {
61+
handleFixedPopover(
62+
_ref,
63+
parent,
64+
(props.placement as unknown as string) ?? 'bottom'
65+
);
66+
}
6467
}, 1);
6568
}
6669
},

0 commit comments

Comments
 (0)