fix(action-corners): check hideWhenDisabled at both the evaluator and prop levels (#5149)
This commit is contained in:
parent
3f1ea26eba
commit
d6d3fa7ef4
@ -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
|
||||
};
|
||||
|
||||
Loading…
Reference in New Issue
Block a user