-
Notifications
You must be signed in to change notification settings - Fork 13
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
zoom/pan should be saved and restored on reloading if "autofit on new design" is off #894
Comments
@dave-doty Do I need to use the same design to replicate this problem? I tried to replace this bug with a different design and when I have the "auto-fit on loading new design" box checked, if I zoom/pan to a random amount and then I reload the page, it is being auto-fitted to the default autofit size every time. That is what we want, correct? Please let me know as I feel like I may be misunderstanding something. |
Then I guess we need to figure out why it's doing the correct thing on one design and not another. :) I suspect it might be a difference between our browsers, maybe you'll get the correct behavior on this design also, and the problem is my browser. Then it's a headache to figure out why we are getting different behavior. But any design where you can replicate this bug is good to find. |
Oh, okay. Yeah, it is probably the browser. I will find a design that can replicate the bug, and then move forward from there. |
If you are seeing that it behaves correctly, then actually I'm a bit confused by that. I am trying to find where we would store the pan/zoom level in between page refreshes, and don't see it. It's not stored in the Redux state (so not written to localStorage as part of I don't see any code in index.html that writes the pan/zoom level to localStorage so that it can be reloaded on page refresh. So I think this feature was actually never implemented. I'll reclassify the issue as an enhancement instead of a bug for that reason. |
What I am seeing is that half of it behaves correctly. The part where it should auto-fit on page refreshes works, but the part where it should reset to something that is the previous zoom/pan level is not happening. I just looked through the web/index.html file and the set-up code near line 349, and it matches what you just clarified. Thanks for making this clearer. |
So to be clear, I think the way to handle this is to set up a listener for when the pan/zoom changes (I think there already are such listeners set up at index.html called Name the localStorage keys |
Ah, sounds good. |
With this option:
If you are at a particular zoom/pan level:
Reloading the page should restore the same zoom/pan. However, it resets it to something that is neither the previous zoom/pan, nor autofit:
The text was updated successfully, but these errors were encountered: