-
Couldn't load subscription status.
- Fork 1.3k
Closed
Labels
Description
Provide a general summary of the issue here
I was having a bug with useTooltipTrigger, so I checked the code and found out that even though triggerProps have the data type of DOMAttributes & PressProps & HoverProps & FocusEvents, fields from the last 3 types are never returned in the code. I think this might be an error.
let {hoverProps} = useHover({
isDisabled,
onHoverStart,
onHoverEnd
});
let {pressProps} = usePress({onPressStart});
let {focusableProps} = useFocusable({
isDisabled,
onFocus,
onBlur
}, ref);
return {
triggerProps: {
'aria-describedby': state.isOpen ? tooltipId : undefined,
...mergeProps(focusableProps, hoverProps, pressProps) // these are all variables with type DOMAttributes
},
tooltipProps: {
id: tooltipId
}
};🤔 Expected Behavior?
triggerProps type should only be DOMAttributes.
😯 Current Behavior
triggerProps type is DOMAttributes & PressProps & HoverProps & FocusEvents.
💁 Possible Solution
- Return extra methods for
triggerPropsto satisfy the data type. - Remove
PressProps & HoverProps & FocusEventsfromtriggerPropsdefinition.
🔦 Context
No response
🖥️ Steps to Reproduce
See the code in this link.
Version
@react-aria/tooltip v3.6.1
What browsers are you seeing the problem on?
Other
If other, please specify.
No response
What operating system are you using?
MacOS
🧢 Your Company/Team
No response
🕷 Tracking Issue
No response