fix(action-corners): check hideWhenDisabled at both the evaluator and prop levels (#5149)

This commit is contained in:
Ibrahim authored and GitHub committed 2025-06-20 11:26:26 -04:00
1 parent 3f1ea26eba
commit d6d3fa7ef4
1 file changed
+3 -1
@@ -310,11 +310,13 @@ export default class ToolbarService extends PubSubService {
typeof props.evaluate === 'function'
? props.evaluate({ ...refreshProps, button })
: undefined;
// Check hideWhenDisabled at both evaluateProps level and props level
const hideWhenDisabled = evaluateProps?.hideWhenDisabled || props.hideWhenDisabled;
const updatedProps = {
...props,
...evaluated,
disabled: evaluated?.disabled || false,
visible: evaluateProps?.hideWhenDisabled && evaluated?.disabled ? false : true,
visible: hideWhenDisabled && evaluated?.disabled ? false : true,
className: evaluated?.className || '',
isActive: evaluated?.isActive, // isActive will be undefined for buttons without this prop
};