We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c140f1f commit 509a58dCopy full SHA for 509a58d
plugins/main/public/components/common/permissions/button.tsx
@@ -59,13 +59,12 @@ export const WzButtonPermissions = ({
59
...(!['link', 'switch'].includes(buttonType)
60
? { isDisabled: disabled }
61
: { disabled }),
62
- onClick:
63
- disabled || !rest.onClick || buttonType == 'switch'
64
- ? undefined
65
- : rest.onClick,
66
- onChange: disabled || !rest.onChange ? undefined : rest.onChange,
+ onClick: disabled || !rest.onClick ? undefined : rest.onClick,
+ onChange:
+ !disabled || rest.onChange || buttonType === 'switch'
+ ? rest.onChange
+ : undefined,
67
};
68
-
69
if (buttonType == 'switch') delete additionalProps.onClick;
70
71
return additionalProps;
0 commit comments