Skip to content

Commit

Permalink
elyra-ai#2264 Common Properties Button is hidden on height change
Browse files Browse the repository at this point in the history
Signed-off-by: srikant <[email protected]>
  • Loading branch information
srikant-ch5 committed Dec 10, 2024
1 parent 7722fc0 commit fb39372
Showing 1 changed file with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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() {
Expand Down

0 comments on commit fb39372

Please sign in to comment.