From 724397b9ca908e6090a43b2491fe4444464eaaa9 Mon Sep 17 00:00:00 2001 From: DorijanH Date: Fri, 2 Feb 2024 13:28:35 +0100 Subject: [PATCH] fix: Propertly disabling the DropdownButton --- packages/react-ui/DropdownButton/DropdownButton.tsx | 6 +++--- ...ly disabling the button if the disable prop is passed in | 0 2 files changed, 3 insertions(+), 3 deletions(-) create mode 100644 packages/react-ui/changes/Fixed [DropdownButton] Properly disabling the button if the disable prop is passed in diff --git a/packages/react-ui/DropdownButton/DropdownButton.tsx b/packages/react-ui/DropdownButton/DropdownButton.tsx index 41a2f319..12a27d5c 100644 --- a/packages/react-ui/DropdownButton/DropdownButton.tsx +++ b/packages/react-ui/DropdownButton/DropdownButton.tsx @@ -27,7 +27,7 @@ export type DropdownButtonProps = Omit & { * @public */ export function DropdownButton({ - options, onClick, icon, ...rest + options, onClick, icon, disabled, ...rest }: DropdownButtonProps) { const id = useId(); const [open, setOpen] = useState(false); @@ -60,7 +60,7 @@ export function DropdownButton({ {...rest} aria-describedby={id} onClick={handleButtonClick} - disabled={!options?.length} + disabled={disabled || !options?.length} > {icon} @@ -69,7 +69,7 @@ export function DropdownButton({ {...rest} aria-describedby={id} onClick={handleButtonClick} - disabled={!options?.length} + disabled={disabled || !options?.length} /> )}