question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Viewport addon not working as expected

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:13 (10 by maintainers)

github_iconTop GitHub Comments

2reactions
Armaniocommented, 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. 🔝

2reactions
Armaniocommented, Apr 10, 2019

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Viewport addon not working as expected · Issue #6392
Describe the bug After registering the addon it's icon shows up in the storybook window but the behavior is odd.
Read more >
Storybook's viewport-addon not showing custom ...
I'm having troubles getting Storybook to display my set of viewports, it instead displays the MINIMAL_VIEWPORTS
Read more >
⚓ T100380 Pie View Menu not working in Edit mode
Worked : (newest version of Blender that worked as expected). Addon Information Name: 3D Viewport Pie Menus (1, 2, 9) Author: meta-androcto.
Read more >
Stop resizing your browser — Storybook viewport - YouTube
Viewports. They take your perfect layout and force them into constraints you didn't plan for…Fortunately, Storybook has you covered.
Read more >
Visual Regression Testing and React Storybook
Thus all the styling should work as expected for different consumer of ... And last but not least, you can make use of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found