Open tuananhlai opened 1 year ago
Looks like the correct change since triggerProps
is intended to go to an element and not into another hook.
I think returning extra methods to satisfy PressProps & HoverProps & FocusEvents
would be better. If not, react-spectrum's Button
(or any button created with useButton
) could not work as trigger for this tooltip.
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 thoughtriggerProps
have the data type ofDOMAttributes & PressProps & HoverProps & FocusEvents
, fields from the last 3 types are never returned in the code. I think this might be an error.https://github.com/adobe/react-spectrum/blob/be501251a2012b2c1401e79940cbb39151c84d9d/packages/%40react-aria/tooltip/src/useTooltipTrigger.ts#L25C1-L25C1
🤔 Expected Behavior?
triggerProps
type should only beDOMAttributes
.😯 Current Behavior
triggerProps
type isDOMAttributes & PressProps & HoverProps & FocusEvents
.💁 Possible Solution
triggerProps
to satisfy the data type.PressProps & HoverProps & FocusEvents
fromtriggerProps
definition.🔦 Context
No response
🖥️ Steps to Reproduce
See the code in this link.
https://github.com/adobe/react-spectrum/blob/be501251a2012b2c1401e79940cbb39151c84d9d/packages/%40react-aria/tooltip/src/useTooltipTrigger.ts#L25C1-L25C1
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