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'
|
typeof props.evaluate === 'function'
|
||||||
? props.evaluate({ ...refreshProps, button })
|
? props.evaluate({ ...refreshProps, button })
|
||||||
: undefined;
|
: undefined;
|
||||||
|
// Check hideWhenDisabled at both evaluateProps level and props level
|
||||||
|
const hideWhenDisabled = evaluateProps?.hideWhenDisabled || props.hideWhenDisabled;
|
||||||
const updatedProps = {
|
const updatedProps = {
|
||||||
...props,
|
...props,
|
||||||
...evaluated,
|
...evaluated,
|
||||||
disabled: evaluated?.disabled || false,
|
disabled: evaluated?.disabled || false,
|
||||||
visible: evaluateProps?.hideWhenDisabled && evaluated?.disabled ? false : true,
|
visible: hideWhenDisabled && evaluated?.disabled ? false : true,
|
||||||
className: evaluated?.className || '',
|
className: evaluated?.className || '',
|
||||||
isActive: evaluated?.isActive, // isActive will be undefined for buttons without this prop
|
isActive: evaluated?.isActive, // isActive will be undefined for buttons without this prop
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user