-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Viewport: Store viewport, rotation in globals #23448
Conversation
dd1e3ba
to
afebe5b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks really good! I think there's a bug with the viewportRotated
global though.
if you navigate to:
https://62f0fd349c07f78d10b7c017-fetfklaray.chromatic.com/?path=/story/example-button--primary&globals=viewport:mobile1;viewportRotated:!true
it will remove the rotated global and leave the url like so, not loading the viewport in landscape mode:
https://62f0fd349c07f78d10b7c017-fetfklaray.chromatic.com/?path=/story/example-button--primary&globals=viewport:mobile1
@shilman Anything that we can do to help get this merged? |
closing in favor of #25321 |
Closes N/A
What I did
Instead of storing the viewport & rotation in addon state, store them in globals.
This has two benefits:
a.
viewport
controls device settingsb.
viewportRotated
controls device orientationHow to test
Page
stories & note URL changesviewport
stories in the sandbox and do the same