Skip to content

Commit

Permalink
fix(ui): disable doc submenu when parent button is disabled (#9750)
Browse files Browse the repository at this point in the history
  • Loading branch information
akhrarovsaid authored Dec 5, 2024
1 parent de53f2a commit 1ab3be6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/ui/src/elements/Button/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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() })}
Expand Down
4 changes: 4 additions & 0 deletions packages/ui/src/elements/Popup/PopupTrigger/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,9 @@
&--size-large {
padding: base(0.8);
}

&--disabled {
cursor: not-allowed;
}
}
}
1 change: 1 addition & 0 deletions packages/ui/src/elements/Popup/PopupTrigger/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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(' ')
Expand Down

0 comments on commit 1ab3be6

Please sign in to comment.