Skip to content

Commit

Permalink
 elyra-ai#2287 Fixed Common properties callbacks don't update on re-r…
Browse files Browse the repository at this point in the history
…ender

Signed-off-by: Neha Gokhale <[email protected]>
  • Loading branch information
nmgokhale committed Jan 3, 2025
1 parent 687f337 commit b316602
Showing 1 changed file with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,22 @@ class PropertiesMain extends React.Component {
this.props.callbacks.setPropertiesHasMounted();
}

componentDidUpdate(prevProps) {
if (!isEqual(prevProps.callbacks, this.props.callbacks)) {
this.propertiesController.setHandlers({
controllerHandler: this.props.callbacks.controllerHandler,
propertyListener: this.props.callbacks.propertyListener,
actionHandler: this.props.callbacks.actionHandler,
buttonHandler: this.props.callbacks.buttonHandler,
buttonIconHandler: this.props.callbacks.buttonIconHandler,
validationHandler: this.props.callbacks.validationHandler,
titleChangeHandler: this.props.callbacks.titleChangeHandler,
tooltipLinkHandler: this.props.callbacks.tooltipLinkHandler,
propertyIconHandler: this.props.callbacks.propertyIconHandler,
});
}
}

UNSAFE_componentWillReceiveProps(newProps) { // eslint-disable-line camelcase, react/sort-comp
if (this.props.light !== newProps.light) { // set the new light prop in controller
this.propertiesController.setLight(newProps.light);
Expand Down

0 comments on commit b316602

Please sign in to comment.