From a2629bf8303c8b8a76e9626c1b45e91bc9b3795e Mon Sep 17 00:00:00 2001 From: Application-drop-up Date: Tue, 1 Sep 2026 08:01:14 +0900 Subject: [PATCH] fix: set aria-describedby when overlay is a falsy but valid node overlay values like 0 are valid renderable content, but the previous `overlay && open` check treated them as absent and skipped aria-describedby even while the tooltip was visible. --- src/Tooltip.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Tooltip.tsx b/src/Tooltip.tsx index ac1ea87..fc67dcb 100644 --- a/src/Tooltip.tsx +++ b/src/Tooltip.tsx @@ -121,7 +121,7 @@ const Tooltip = React.forwardRef((props, ref) => { const getChildren: TriggerProps['children'] = ({ open }) => { const child = React.Children.only(children); const childAriaDescribedBy = (child.props as React.AriaAttributes)['aria-describedby']; - const ariaDescribedBy = [childAriaDescribedBy, overlay && open ? mergedId : undefined] + const ariaDescribedBy = [childAriaDescribedBy, overlay != null && open ? mergedId : undefined] .filter(Boolean) .join(' '); const ariaProps: React.AriaAttributes = {