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

[Bug]: Viewports aren’t reset when navigating away from a story with a default viewport #27073

Open
JReinhold opened this issue May 9, 2024 · 1 comment

Comments

@JReinhold
Copy link
Contributor

Describe the bug

When navigating to a story with a defaultViewport, that viewport is correctly applied, and the globals query param in the URL is updated accordingly. When navigating away to a story without an explicit viewport, the global stays there, meaning that the viewport is still applied, even though the story doesn't have a default viewport.

To Reproduce

System

Storybook 8.1.0-alpha.8

Additional context

No response

@shilman
Copy link
Member

shilman commented May 9, 2024

I updated the viewports addon to store its state in globals in 8.0 as a step towards standardizing on globals for most addon state. This results in the behavior you describe and I don't plan to fix this.

@tmeasday is working on global overrides per #23347 and if those are finished it would have the desired behavior you describe when completed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants