diff --git a/.changeset/olive-hairs-listen.md b/.changeset/olive-hairs-listen.md new file mode 100644 index 0000000000..dd09d4e24e --- /dev/null +++ b/.changeset/olive-hairs-listen.md @@ -0,0 +1,5 @@ +--- +"@heroui/tabs": patch +--- + +fix tabs handleClick (#5357) diff --git a/packages/components/tabs/src/tab.tsx b/packages/components/tabs/src/tab.tsx index d3166461b9..f9dd9f485a 100644 --- a/packages/components/tabs/src/tab.tsx +++ b/packages/components/tabs/src/tab.tsx @@ -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}