Fix dropdown opening on first click of inactive tab

This commit is contained in:
Gregory Schier
2026-01-13 09:24:44 -08:00
parent ae2f2459e9
commit b5753da3b7

View File

@@ -369,7 +369,12 @@ function TabButton({
const btnProps: Partial<ButtonProps> = {
color: 'custom',
justify: layout === 'horizontal' ? 'start' : 'center',
onClick: isActive ? undefined : () => onChangeValue(tab.value),
onClick: isActive
? undefined
: (e: React.MouseEvent) => {
e.preventDefault(); // Prevent dropdown from opening on first click
onChangeValue(tab.value);
},
className: classNames(
'flex items-center rounded whitespace-nowrap',
'!px-2 ml-[1px]',