Skip to content

Viewport addon has unnecessary scrollbar when dimension is set to 100% #6536

@mtlewis

Description

@mtlewis

When one of the dimensions of the viewport is set to 100%, the additional margin added around the iframe causes an unnecessary scrollbar. Since the height is a percentage, it doesn't seem to make sense to force the content to be exactly 100% of the height of the storybook preview area - instead, it should probably take the extra margin into account.

To Reproduce
Steps to reproduce the behavior:

  1. Configure the viewport addon with a viewport with either width or height set to 100%
  2. Choose that viewport
  3. Observe that the viewport is slightly bigger than the available space.

Expected behavior
Viewport size is reduced slightly to avoid the unnecessary scrollbar. Note that this should probably do the right thing even if the viewport is close to 100%.

Screenshots
Current Behaviour:
Screenshot 2019-04-16 at 11 12 55

Proposed Behaviour
Screenshot 2019-04-16 at 11 13 22

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions