geometricpanda icon indicating copy to clipboard operation
geometricpanda copied to clipboard

storybook-addon-iframe doesn't adhere to viewMode param.

Open bring2dip opened this issue 2 years ago • 2 comments

🐞 bug report

Affected Package

@geometricpanda/storybook-addon-iframe doesn't seem to adhere to viewMode options parameter. I want to open the page in Docs tab by default.

Note:

[ADDON_IFRAME]: {
        title: 'Docs',
},

Description

@geometricpanda/storybook-addon-iframe doesn't seem to adhere to viewMode options parameter. I want to open the in Docs tab by default.

🔬 Minimal Reproduction

By default the following path query param is set even though I set the viewMode in parameters.

http://localhost:6006/?path=/story/about--page

Expected:

http://localhost:6006/?path=/iframe/about--page

🌍 Your Environment

Storybook Version:

"@storybook/react": "6.5.0-alpha.5",


@geometricpanda Version:

"@geometricpanda/storybook-addon-iframe": "0.2.1",


bring2dip avatar Feb 25 '22 16:02 bring2dip

yeah unfortunately this is a limitation within storybook - without getting into too much detail, it would require fairly intrusive customisation of the Storybook routing (similar to how docs works) and become fragile should there ever be future changes (which with V7 there will likely be).

I could look at exposing the inner iframe and loading mechanism so that it's consumable in a Docs Block, that way you could embed it within an MDX file - which would in turn allow you to use the in-build storybook docs routing

geometricpanda avatar Mar 02 '22 11:03 geometricpanda

That would be great :) . It's a nice to have feature.

bring2dip avatar Mar 04 '22 11:03 bring2dip