fix(components): Fix 'Tap to click' behavior on macOS with Edge/Chrome for Accordion and Tab (#2725)

* fix(components): fix 'Tap to click' behavior on macOS

* Add change file for accordion, menu, and tabs

* Remove 'fix(components)' from the .changeset file

* fix(components): undo dropdown change now that it's no longer applicable

* fix(components): update changeset file now that we are no longer modifying the dropdown component
This commit is contained in:
Eric Abreu 2024-05-24 12:20:44 -07:00 committed by GitHub
parent 3b14c21e02
commit 8048dcc0c3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 10 additions and 3 deletions

View File

@ -0,0 +1,6 @@
---
"@nextui-org/accordion": patch
"@nextui-org/tabs": patch
---
Fix 'Tap to click' behavior on macOS for Accordion and Tab

View File

@ -172,8 +172,9 @@ export function useAccordionItem<T extends object = {}>(props: UseAccordionItemP
otherProps.onBlur,
item.props?.onBlur,
),
...mergeProps(buttonProps, hoverProps, pressProps, props),
onClick: chain(pressProps.onClick, onClick),
...mergeProps(buttonProps, hoverProps, pressProps, props, {
onClick: chain(pressProps.onClick, onClick),
}),
};
};

View File

@ -111,11 +111,11 @@ const Tab = forwardRef<"button", TabItemProps>((props, ref) => {
enabled: shouldFilterDOMProps,
omitPropNames: new Set(["title"]),
}),
{onClick: handleClick},
)}
className={slots.tab?.({class: tabStyles})}
title={otherProps?.titleValue}
type={Component === "button" ? "button" : undefined}
onClick={handleClick}
>
{isSelected && !disableAnimation && !disableCursorAnimation && isMounted ? (
<LazyMotion features={domMax}>