fix(ui): disable doc submenu when parent button is disabled (#9750)

This commit is contained in:
Said Akhrarov
2024-12-05 15:56:00 -05:00
committed by GitHub
parent de53f2a826
commit 1ab3be65f8
3 changed files with 6 additions and 0 deletions

View File

@@ -183,6 +183,7 @@ export const Button = forwardRef<HTMLAnchorElement | HTMLButtonElement, Props>((
button={<ChevronIcon />}
buttonSize={size}
className={disabled ? `${baseClass}--popup-disabled` : ''}
disabled={disabled}
horizontalAlign="right"
noBackground
render={({ close }) => SubMenuPopupContent({ close: () => close() })}

View File

@@ -27,5 +27,9 @@
&--size-large {
padding: base(0.8);
}
&--disabled {
cursor: not-allowed;
}
}
}

View File

@@ -25,6 +25,7 @@ export const PopupTrigger: React.FC<PopupTriggerProps> = (props) => {
`${baseClass}--${buttonType}`,
!noBackground && `${baseClass}--background`,
size && `${baseClass}--size-${size}`,
disabled && `${baseClass}--disabled`,
]
.filter(Boolean)
.join(' ')