fix: Re-selecting dropdown value triggers evaluation cycle (#16201)
This commit is contained in:
parent
88fe538a70
commit
1a71a14319
|
|
@ -39,7 +39,8 @@ class ActionSelectorControl extends BaseControl<ControlProps> {
|
|||
};
|
||||
|
||||
handleValueUpdate = (newValue: string, isUpdatedViaKeyboard = false) => {
|
||||
const { propertyName } = this.props;
|
||||
const { propertyName, propertyValue } = this.props;
|
||||
if (!propertyValue && !newValue) return;
|
||||
this.updateProperty(propertyName, newValue, isUpdatedViaKeyboard);
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -15,12 +15,22 @@ class BaseControl<P extends ControlProps, S = {}> extends Component<P, S> {
|
|||
propertyValue: any,
|
||||
isUpdatedViaKeyboard?: boolean,
|
||||
) {
|
||||
if (!_.isNil(this.props.onPropertyChange))
|
||||
if (
|
||||
this.props.propertyValue === undefined &&
|
||||
propertyValue === this.props.defaultValue
|
||||
) {
|
||||
return;
|
||||
}
|
||||
if (
|
||||
!_.isNil(this.props.onPropertyChange) &&
|
||||
this.props.propertyValue !== propertyValue
|
||||
) {
|
||||
this.props.onPropertyChange(
|
||||
propertyName,
|
||||
propertyValue,
|
||||
isUpdatedViaKeyboard,
|
||||
);
|
||||
}
|
||||
}
|
||||
deleteProperties(propertyPaths: string[]) {
|
||||
if (this.props.deleteProperties) {
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ export default {
|
|||
dependencies: ["primaryColumns", "columnType"],
|
||||
label: "Cell Wrapping",
|
||||
helpText: "Allows content of the cell to be wrapped",
|
||||
defaultValue: true,
|
||||
defaultValue: false,
|
||||
controlType: "SWITCH",
|
||||
customJSControl: "TABLE_COMPUTE_VALUE",
|
||||
isJSConvertible: true,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user