mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-04-22 08:38:29 +02:00
Fix dropdown opening on first click of inactive tab
This commit is contained in:
@@ -369,7 +369,12 @@ function TabButton({
|
|||||||
const btnProps: Partial<ButtonProps> = {
|
const btnProps: Partial<ButtonProps> = {
|
||||||
color: 'custom',
|
color: 'custom',
|
||||||
justify: layout === 'horizontal' ? 'start' : 'center',
|
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(
|
className: classNames(
|
||||||
'flex items-center rounded whitespace-nowrap',
|
'flex items-center rounded whitespace-nowrap',
|
||||||
'!px-2 ml-[1px]',
|
'!px-2 ml-[1px]',
|
||||||
|
|||||||
Reference in New Issue
Block a user