Skip to content

Commit e26f1c9

Browse files
committed
keep popup open when focused
1 parent 74a2b90 commit e26f1c9

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

builder-frontend/src/components/shared/Tooltip.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,13 @@ export default function QuestionTooltip(props: TooltipProps) {
7373
class="relative inline-flex items-center justify-center cursor-help"
7474
onMouseEnter={show}
7575
onMouseLeave={hide}
76-
onFocus={show}
77-
onBlur={hide}
76+
onFocusIn={show}
77+
onFocusOut={(e: FocusEvent) => {
78+
// Only hide if focus is leaving the entire tooltip container
79+
if (!containerRef?.contains(e.relatedTarget as Node)) {
80+
hide();
81+
}
82+
}}
7883
tabIndex={0}
7984
aria-label="More information"
8085
>
@@ -91,8 +96,6 @@ export default function QuestionTooltip(props: TooltipProps) {
9196
? "left-0"
9297
: "right-0"
9398
}`}
94-
onMouseEnter={show}
95-
onMouseLeave={hide}
9699
>
97100
{props.children}
98101
{/* Decorative arrow pointing up */}

0 commit comments

Comments
 (0)