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

Multiple experimental-figspec in same Story are not working as expected #122

Closed
2 of 11 tasks
sauldeleon opened this issue Sep 10, 2021 · 1 comment · Fixed by #126
Closed
2 of 11 tasks

Multiple experimental-figspec in same Story are not working as expected #122

sauldeleon opened this issue Sep 10, 2021 · 1 comment · Fixed by #126
Assignees
Labels
category: bug Something isn't working
Milestone

Comments

@sauldeleon
Copy link

Affected design types

  • figma
  • experimental-figspec
  • link
  • image
  • iframe

Describe the bug

When adding multiple designs to the design parameter section, multiple experimental-figspec are not allowed, or only the first one will work.

How to reproduce the bug?

Create a storybook and add the following configuration in the design section:

 parameters: {
    design: [
      {
        name: 'Dropdown list design',
        type: 'experimental-figspec',
        accessToken: 'awesome-token',
        url: 'https://www.figma.com/blabblablabla,
      },
      {
        name: 'Dropdown button design',
        type: 'experimental-figspec',
        accessToken: 'awesome-token',
        url: 'https://www.figma.com/bleblebleble,
      },
    ],
  },

The first item in the array will work with the Figma spec, but the second figma design will have a strange behaviour, like being stuck.

Adding a fig-spec and a figma will work normally

 parameters: {
    design: [
      {
        name: 'Dropdown list design',
        type: 'experimental-figspec',
        accessToken: 'awesome-token',
        url: 'https://www.figma.com/blabblablabla,
      },
      {
        name: 'Dropdown button design',
        type: 'Figma',
        url: 'https://www.figma.com/bleblebleble,
      },
    ],
  },

Expected behaviour

I guess adding 2 figspecs experimental should work normally, changing the tab would set the iframe to the correct figma url allowing to play with the different Figma elements.

Environment

  • Chrome / Chromium / Chromium based browsers
  • Firefox
  • macOS Safari
  • iOS Safari
  • Samsung Internet
  • Other

Affected versions

6.1.0

Storybook versions

6.3.8

@sauldeleon sauldeleon added the category: bug Something isn't working label Sep 10, 2021
@pocka pocka self-assigned this Oct 2, 2021
pocka added a commit that referenced this issue Oct 2, 2021
#122

When a story with `type: "experimental-figspec"` places on 2nd or
later tab, the preview does not render Figma design correctly.
This is due to size calculation not updating on `display` changes.

However, the fundamentaly fix for it requires ResizeObserver,
which is still relatively new API. I would like to avoid these "young"
APIs in libraries because of documentation and/or additional dependency
management.

The Figspec type viewer can't have an instant tab switching while force
re-render is on, although I don't think it's a deal breaker.
@pocka pocka closed this as completed in #126 Oct 2, 2021
@pocka pocka added this to the v6.2.0 milestone Oct 2, 2021
@pocka
Copy link
Collaborator

pocka commented Oct 2, 2021

Fixed in v6.2.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants