Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#2264 Common Properties Button is hidden on height change #2265

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason you have _width and not just width to match height?

Copy link
Contributor Author

@srikant-ch5 srikant-ch5 Dec 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since width is not used anywhere in the function build was failing due to unused variable error so to overcome it I included _.

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
Loading