fix(tooltip): behavior of tooltip trigger with delay (#1278)

* fix(tooltip): use trigger-props instead of custom on-pointer events

* chore(changeset): add tooltip changeset
This commit is contained in:
Tianen Pang 2023-08-05 21:46:01 +08:00 committed by GitHub
parent cd1dc8b469
commit a1a02dc0db
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View File

@ -0,0 +1,5 @@
---
"@nextui-org/tooltip": patch
---
Fix the trigger behavior to prevent it from opening again after the delay is not reached and the cursor moves out.

View File

@ -208,8 +208,6 @@ export function useTooltip(originalProps: UseTooltipProps) {
...mergeProps(triggerProps, props),
ref: mergeRefs(_ref, triggerRef),
"aria-describedby": isOpen ? tooltipId : undefined,
onPointerEnter: () => state.open(),
onPointerLeave: () => state.isOpen && state.close(),
}),
[triggerProps, isOpen, tooltipId, state],
);