fix(tabs): onClick (#5378)

* fix(tabs): handleClick

* chore(changeset): add changeset
This commit is contained in:
WK 2025-06-17 16:32:39 +08:00 committed by GitHub
parent 7dff993e1d
commit dd63b83b6b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 3 deletions

View File

@ -0,0 +1,5 @@
---
"@heroui/tabs": patch
---
fix tabs handleClick (#5357)

View File

@ -79,8 +79,6 @@ const Tab = forwardRef<"button", TabItemProps>((props, ref) => {
});
const handleClick = () => {
chain(onClick, tabProps.onClick)();
if (!domRef?.current || !listRef?.current) return;
scrollIntoView(domRef.current, {
@ -115,7 +113,7 @@ const Tab = forwardRef<"button", TabItemProps>((props, ref) => {
enabled: shouldFilterDOMProps,
omitPropNames: new Set(["title"]),
}),
{onClick: handleClick},
{onClick: chain(handleClick, onClick, tabProps.onClick)},
)}
className={slots.tab?.({class: tabStyles})}
title={otherProps?.titleValue}