From 22fa4310773086a7b1d4814ce06b19d795c8081f Mon Sep 17 00:00:00 2001 From: sarah Date: Tue, 29 Oct 2024 16:59:48 +0500 Subject: [PATCH] fix(rac): Improve the comment to explain Tooltip Button Change-Id: Ibca1d4342b4154a74538bd51661be832ca7e3934 GitOrigin-RevId: 2391ebf8cf9a10478acdc1f116fec730c6a894dc --- plasmicpkgs/react-aria/src/registerTooltip.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plasmicpkgs/react-aria/src/registerTooltip.tsx b/plasmicpkgs/react-aria/src/registerTooltip.tsx index 652fa65e2b9..088d3e151dd 100644 --- a/plasmicpkgs/react-aria/src/registerTooltip.tsx +++ b/plasmicpkgs/react-aria/src/registerTooltip.tsx @@ -40,7 +40,10 @@ const { variants, withObservedValues } = React Aria's TooltipTrigger only allows Aria Button component to act as a trigger. https://react-spectrum.adobe.com/react-aria/Tooltip.html#example -To bypass that limitation, we use useButton, +To bypass that limitation, we originally used the useTooltipTrigger custom hooks for advanced customization, so the trigger could become anything we want. +One of the limitations with that was the placement prop - the useTooltipTrigger did not provide placement prop, and that caused issues with tooltip positioning. + +We have a better fix now - instead of using useTooltipTrigger, we use useButton, so that anything we add to the slot can be treated as an Aria Button. That means we can use the ready-made components provided by react-aria-components (like and ) and still be able to use any other component as a trigger.