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

Pseudo states not being applied in fullscreen/iframe mode #61

Open
harrync opened this issue Mar 8, 2023 · 2 comments
Open

Pseudo states not being applied in fullscreen/iframe mode #61

harrync opened this issue Mar 8, 2023 · 2 comments

Comments

@harrync
Copy link

harrync commented Mar 8, 2023

Loving this plugin, but am having an issue where the states aren't being applied in iframe mode (I'm using this mode for testing in Cypress)

Works perfectly (i.e. default SB) -
http://localhost:6006/?path=/story/atoms-button--primary-medium&globals=pseudo.hover:true

Doesn't work (iframe mode) -
http://localhost:6006/iframe.html?globals=pseudo.hover:true&id=atoms-button--primary-medium&viewMode=story

Many thanks

@Sidnioulz
Copy link

Sidnioulz commented May 3, 2023

Cannot repro on SB 7.0.7 with Vite and Vue 3.

@harrync I suspect you're running SB 6? It would help to give information on your framework too, as the code to inject globals and controls in stories is more coupled with frameworks in SB 6 than SB 7.

@xsu1010
Copy link

xsu1010 commented Jan 19, 2024

Sorry to necro this issue, but I just came across the same problem and wanted to share a workaround that worked for me:

If I just pass the globals=pseudo.hover:true to any story's iframe url, the elements don't get a pseudo-hover-all class applied to them, and the hover states aren't applied at all:

image

However, if I create a new story and explicitly set its pseudo.hover parameter, it works as intended, e.g.:

export const VariantHover: Story = {
    render: Variants.render,
    parameters: {
        pseudo: {
            hover: true,
        },
    },
};

The pseudo-hover-all class now gets added to the elements in the iframe page, and the hover state gets applied to them:

image

Now I'm left wondering if this is the intended behaviour? As I have various stories that I need to test, it seems a bit overkill that each of them needs a dedicated story to test the hover/pressed/focused states each 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants