From 687f337104a237c89862104fe7777bf66cee3baf Mon Sep 17 00:00:00 2001 From: srikant Date: Thu, 2 Jan 2025 18:18:11 +0530 Subject: [PATCH] #2264 Common Properties Button is hidden on height change (#2265) Signed-off-by: srikant --- .../properties-main/properties-main.jsx | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/canvas_modules/common-canvas/src/common-properties/properties-main/properties-main.jsx b/canvas_modules/common-canvas/src/common-properties/properties-main/properties-main.jsx index e16128334..26b8d8ad4 100644 --- a/canvas_modules/common-canvas/src/common-properties/properties-main/properties-main.jsx +++ b/canvas_modules/common-canvas/src/common-properties/properties-main/properties-main.jsx @@ -101,6 +101,8 @@ class PropertiesMain extends React.Component { this.detectResize = this.detectResize.bind(this); // used to tracked when the resize button is clicked and ignore detectResize this.resizeClicked = false; + // Track panel height to avoid resize calls whenever height changes + this.lastPanelHeight = 0; } componentDidMount() { @@ -455,12 +457,15 @@ class PropertiesMain extends React.Component { } } - detectResize() { - // only hide resize button if resize wasn't from clicking resize button - if (!this.resizeClicked) { - this.setState({ showResizeBtn: false }); + detectResize(_width, height) { + if (height === this.lastPanelHeight) { + // only hide resize button if resize wasn't from clicking resize button + if (!this.resizeClicked) { + this.setState({ showResizeBtn: false }); + } + this.resizeClicked = false; } - this.resizeClicked = false; + this.lastPanelHeight = height; } render() {