You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the useTooltipTrigger as described in documentation -
let { triggerProps, tooltipProps } = useTooltipTrigger(props, state, ref);
- the triggerProps have onPointerEnter prop that is supposed to be used on the element that should reveal the tooltip.
This works fine when used on a regular <button> element, but when used with useButton on my own Button component, it will fail to open the tooltip. The useButton does not return the onPointerEnter within its buttonProps, it gets ignored and removed.
🤔 Expected Behavior?
I am able to see two possible behaviors that I would like to see
The buttonProps from useButton should also include any other valid event callbacks that are passed to the useButton
The useTooltipTrigger should return onHover and similar properties that are accepted by useHover so I can use useHover internally within my Button component - (not favorite for many reasons)
Maybe there is a better solution I do not see. Currently, My current solution is to just take { onPointerEnter } = props out and apply it directly
😯 Current Behavior
Tooltip build with useTooltipTrigger does not work when triggered by Button build with useButton
Provide a general summary of the issue here
When using the
useTooltipTrigger
as described in documentation -let { triggerProps, tooltipProps } = useTooltipTrigger(props, state, ref);
- the
triggerProps
haveonPointerEnter
prop that is supposed to be used on the element that should reveal the tooltip.This works fine when used on a regular
<button>
element, but when used withuseButton
on my ownButton
component, it will fail to open the tooltip. TheuseButton
does not return theonPointerEnter
within itsbuttonProps
, it gets ignored and removed.🤔 Expected Behavior?
I am able to see two possible behaviors that I would like to see
buttonProps
fromuseButton
should also include any other valid event callbacks that are passed to theuseButton
useTooltipTrigger
should returnonHover
and similar properties that are accepted byuseHover
so I can useuseHover
internally within myButton
component - (not favorite for many reasons)Maybe there is a better solution I do not see. Currently, My current solution is to just take
{ onPointerEnter } = props
out and apply it directly😯 Current Behavior
Tooltip build with
useTooltipTrigger
does not work when triggered by Button build withuseButton
💁 Possible Solution
No response
🔦 Context
No response
🖥️ Steps to Reproduce
https://codesandbox.io/p/sandbox/infallible-banach-s5pcyx
Version
"react-aria": "3.33.1"
What browsers are you seeing the problem on?
Chrome
If other, please specify.
No response
What operating system are you using?
Windows
🧢 Your Company/Team
No response
🕷 Tracking Issue
No response
The text was updated successfully, but these errors were encountered: