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

How to handle changes in visual viewport between states #178

Open
jakearchibald opened this issue Aug 10, 2022 · 1 comment
Open

How to handle changes in visual viewport between states #178

jakearchibald opened this issue Aug 10, 2022 · 1 comment

Comments

@jakearchibald
Copy link
Collaborator

For pinch-zoom differences, our options are:

  • Abandon transition if zoom levels are different. Feels like this would drop too many transitions unexpectedly.
  • Transition elements in visual viewport space. I think this would create some really weird transitions the developer wouldn't expect.
  • Transition the visual viewport as part of the transition. I think this is my preferred option.

For differences caused by browser UI (scrollbars, URL bar, keyboard), I think our conclusion is to make the root image sizes match by extending the smaller dimensions with transparent pixels. This wouldn't impact shared elements, which may be a different size on either side of the transition due to UI differences. This seems like a good solution to me.

Related: #133

@khushalsagar
Copy link
Collaborator

Transition the visual viewport as part of the transition. I think this is my preferred option.

+1. Though we'll need to sort out the timing for this animation. For pinch-zoom we should animate the visual viewport likely once we're on the incoming page. As a step before running the SET animations. This is because the final page scale value is known only when the incoming page has loaded.

For the OS keyboard though, I'm not sure how dismissing the keyboard is timed with the navigation to the next page. It's also not clear whether this state is restored similar to page scale or a new navigation always dismisses the keyboard. In which case we could simply hide the keyboard before initiating the navigation.

In either case, I'm hoping we can start with making the change in visual viewport immediate instead of animating it. Since visual viewport bounds don't affect what we capture or how the SET animation is set up. It should be a separate animation orchestrated by the browser.

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

No branches or pull requests

2 participants