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

Viewport addon not working as expected #6392

Closed
lhguerra opened this issue Apr 2, 2019 · 13 comments
Closed

Viewport addon not working as expected #6392

lhguerra opened this issue Apr 2, 2019 · 13 comments
Assignees
Milestone

Comments

@lhguerra
Copy link
Contributor

lhguerra commented Apr 2, 2019

Describe the bug
After registering the addon it's icon shows up in the storybook window but the behavior is odd. Whenever I try to chose a viewport I end up with the same thing.

To Reproduce
Steps to reproduce the behavior:

  1. Install the addon yarn add -D @storybook/addon-viewport
  2. Register it in addons.js
import '@storybook/addon-viewport/register';
  1. Create a story:
import React from 'react';
import { storiesOf } from '@storybook/react';

import ActionDialog from './index';

storiesOf('ActionDialog', module).add('default', () => (
  <ActionDialog>Dialog Content</ActionDialog>
));
  1. Run storybook

Expected behavior
The viewport setting resizes the viewport as shown in the print in the Readme.

Actual behavior
With no breakpoints selected (this is correct)
Screenshot from 2019-04-02 18-14-13

With any breakpoint selected (in this case, iphone6)
Screenshot from 2019-04-02 18-14-23

Notice that it changes the size of the viewport (see scrollbar on the right) but not to the expected size.

System:

  • OS: Ubuntu 16.04
  • Device: Desktop
  • Browser: chrome
  • Framework: react
  • Addons: breakpoint
  • Version: 5.0.6
@shilman
Copy link
Member

shilman commented Apr 3, 2019

Have you taken a look at our example? Does this work as expected on your machine/browser?

https://storybooks-official.netlify.com/?path=/story/ui-panel--default

@lhguerra
Copy link
Contributor Author

lhguerra commented Apr 3, 2019

Yes it does. I cloned the repo and will test the example to see if I find any difference between my setup and what the example does.

@CodeByAlex
Copy link
Member

@shilman, I'm definitely seeing an issue similar to this in next. Example can be found here: https://next--storybooks-vue.netlify.com/?path=/story/welcome--welcome
image

@shilman
Copy link
Member

shilman commented Apr 3, 2019

It looks like this is a problem in next but not master. Perhaps it was introduced in #6045

@lucas-carl mind taking a look at this?

@lucas-carl
Copy link
Contributor

@shilman I looked into the next version right after my PR but can't seem to find any bugs.

@ioanlucut
Copy link

Having the same issue.

@callmephilip
Copy link

Seeing this issue with @next

@mick-feller
Copy link

Same here, broken on @next

@shilman shilman modified the milestones: 5.0.x, 5.1.0 Apr 10, 2019
@shilman
Copy link
Member

shilman commented Apr 10, 2019

@lucas-carl Indeed, I checked and the problem got introduced in alpha.15, probably by this PR: #6126

@Armanio mind looking into this?

@Armanio
Copy link
Member

Armanio commented Apr 10, 2019

I'll check it today. Give me a few hours. 👍

@Armanio
Copy link
Member

Armanio commented Apr 12, 2019

Guys, I apologize: it's my mistake, I fixed zoom and broke background addon.
I create PR to fix my past mistakes. 🔝

@lhguerra
Copy link
Contributor Author

Just tested and it is working just fine. Thank you guys :)

@shilman
Copy link
Member

shilman commented Apr 13, 2019

w00t!! I just released https://github.com/storybooks/storybook/releases/tag/v5.1.0-alpha.26 containing PR #6502 that references this issue. Upgrade today to try it out!

Because it's a pre-release you can find it on the @next NPM tag.

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

8 participants