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

This commit is contained in:
Ibrahim 2025-06-20 11:26:26 -04:00 committed by GitHub
parent 3f1ea26eba
commit d6d3fa7ef4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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
};