diff --git a/packages/web_ui/src/components/VariableDropdownButton.tsx b/packages/web_ui/src/components/VariableDropdownButton.tsx index 3f5f4fb5..ccbef653 100644 --- a/packages/web_ui/src/components/VariableDropdownButton.tsx +++ b/packages/web_ui/src/components/VariableDropdownButton.tsx @@ -15,19 +15,20 @@ export default function VariableDropdownButton(props: VariableDropdownButtonProp return <>; } + const mainDisabled = props.disabled || mainAction.disabled; const buttonProps: DropdownButtonProps = { ...props, danger: mainAction.danger, onClick: (event) => { event.stopPropagation(); - if (mainAction.onClick) { + if (!mainDisabled && mainAction.onClick) { mainAction.onClick(); } }, }; return menuActions.length === 0 - ? : e.domEvent.stopPropagation() }} buttonsRender={([left, right]) => [ - left, React.cloneElement(right as any, { onClick: (e: any) => e.stopPropagation() }), + React.cloneElement(left as any, { disabled: mainDisabled }), + React.cloneElement(right as any, { onClick: (e: any) => e.stopPropagation() }), ]} > {mainAction.label}