Skip to content

Commit 8048dcc

Browse files
authoredMay 24, 2024··
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
1 parent 3b14c21 commit 8048dcc

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed
 

‎.changeset/slimy-ways-repair.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@nextui-org/accordion": patch
3+
"@nextui-org/tabs": patch
4+
---
5+
6+
Fix 'Tap to click' behavior on macOS for Accordion and Tab

‎packages/components/accordion/src/use-accordion-item.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,9 @@ export function useAccordionItem<T extends object = {}>(props: UseAccordionItemP
172172
otherProps.onBlur,
173173
item.props?.onBlur,
174174
),
175-
...mergeProps(buttonProps, hoverProps, pressProps, props),
176-
onClick: chain(pressProps.onClick, onClick),
175+
...mergeProps(buttonProps, hoverProps, pressProps, props, {
176+
onClick: chain(pressProps.onClick, onClick),
177+
}),
177178
};
178179
};
179180

‎packages/components/tabs/src/tab.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,11 +111,11 @@ const Tab = forwardRef<"button", TabItemProps>((props, ref) => {
111111
enabled: shouldFilterDOMProps,
112112
omitPropNames: new Set(["title"]),
113113
}),
114+
{onClick: handleClick},
114115
)}
115116
className={slots.tab?.({class: tabStyles})}
116117
title={otherProps?.titleValue}
117118
type={Component === "button" ? "button" : undefined}
118-
onClick={handleClick}
119119
>
120120
{isSelected && !disableAnimation && !disableCursorAnimation && isMounted ? (
121121
<LazyMotion features={domMax}>

0 commit comments

Comments
 (0)
Please sign in to comment.