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

Ensure DashCanvas layout updated if window resized while hidden #3463

Merged
merged 1 commit into from
Aug 24, 2023

Conversation

amcclain
Copy link
Member

Hoist P/R Checklist

Pull request authors: Review and check off the below. Items that do not apply can also be
checked off to indicate they have been considered. If unclear if a step is relevant, please leave
unchecked and note in comments.

  • Caught up with develop branch as of last change.
  • Added CHANGELOG entry, or determined not required.
  • Reviewed for breaking changes, added breaking-change label + CHANGELOG if so.
  • Updated doc comments / prop-types, or determined not required.
  • Reviewed and tested on Mobile, or determined not required.
  • Created Toolbox branch / PR, or determined not required.

If your change is still a WIP, please use the "Create draft pull request" option in the split
button below to indicate it is not ready yet for a final review.

Pull request reviewers: when merging this P/R, please consider using a squash commit to
collapse multiple intermediate commits into a single commit representing the overall feature
change. This helps keep the commit log clean and easy to scan across releases. PRs containing a
single commit should be rebased when possible.

* `DashCanvas` now properly updates its layout when shown if the browser window had been resized
  while the component was hidden (e.g. in an inactive tab).
* Fixes #3215
@amcclain
Copy link
Member Author

Two things I wasn't 100% sure about:

  • Update to use composeRefs to compose model.ref, the useOnVisibleChange hook, and (this is the part I wasn't clear on) a forwarded ref. I was looking at the pattern in DashContainer and went with that:

  • In the ticket @haynesjm42 filed, he has a delay in his workaround - in local development I was seeing the canvas resize OK without it. Might be a timing difference introduced by the use of the hook? Happy to start without it, but wanted to call that out.

Copy link
Member

@haynesjm42 haynesjm42 left a comment

Choose a reason for hiding this comment

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

Re: the timing, I bet you are correct and that now that we are using the hook and reacting on the visibility of the DashCanvas itself instead of the activeTabId that it is no longer needed

@haynesjm42 haynesjm42 merged commit ae428a8 into develop Aug 24, 2023
@haynesjm42 haynesjm42 deleted the dashCanvasResizeWhenHiddenFix branch August 24, 2023 12:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DashCanvas does not update layout when window resized while not visible
2 participants