mirror of
https://github.com/Kong/insomnia.git
synced 2026-04-20 22:27:24 -04:00
fix: interactivity for components within tooltip body [INS-4773] (#8239)
Attempting to click on links within tooltips would lead to the tooltip being dismissed. This fixes the issue by moving the tooltip to be a sibling of the tooltip trigger, which is the correct structure for react-aria tooltips. Ref: https://react-spectrum.adobe.com/react-aria/useTooltipTrigger.html
This commit is contained in:
committed by
GitHub
parent
d6a6bcb04d
commit
eca35d832b
@@ -49,14 +49,16 @@ export const Tooltip = (props: Props) => {
|
||||
});
|
||||
|
||||
return (
|
||||
<div
|
||||
ref={triggerRef}
|
||||
className={tooltipClasses}
|
||||
style={{ position: 'relative', ...style }}
|
||||
{...trigger.triggerProps}
|
||||
onClick={props.onClick}
|
||||
>
|
||||
{children}
|
||||
<>
|
||||
<div
|
||||
ref={triggerRef}
|
||||
className={tooltipClasses}
|
||||
style={{ position: 'relative', ...style }}
|
||||
{...trigger.triggerProps}
|
||||
onClick={props.onClick}
|
||||
>
|
||||
{children}
|
||||
</div>
|
||||
{state.isOpen && (
|
||||
<OverlayContainer>
|
||||
<div
|
||||
@@ -69,6 +71,6 @@ export const Tooltip = (props: Props) => {
|
||||
</div>
|
||||
</OverlayContainer>
|
||||
)}
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user