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 variants properties not working #164

Open
andreeeabb opened this issue Apr 10, 2024 · 3 comments
Open

Pseudo variants properties not working #164

andreeeabb opened this issue Apr 10, 2024 · 3 comments

Comments

@andreeeabb
Copy link

Describe the problem


Bug report identity: Please do not edit

Task path: WRqbNjeh3JQJI2q3UWHJ/2y0Lg6UBhOeKch64Kys9/7ky1g318bi4ep

@muryoh
Copy link
Member

muryoh commented Apr 10, 2024

Hi @andreeeabb,

Thanks for the report 🙏

I noticed you used advanced variants to specify

{
  "initArgs": {
    ":actionSelector": ".ids-accordion-item__btn:tap"
  },
  "variantProperties": []
}

The reason this is failing is because there is no element matching that selector, .ids-accordion-item__btn:tap

This is actually probably closer to what you were looking to do:

{
  "initArgs": {
    ":actionSelector": ".ids-accordion-item__btn"
  },
  "variantProperties": [
    ":tap"
  ]
}

This tells story.to.design to:

  • interact with the element with class ids-accordion-item when generating pseudo variants (ie click on that element when needed) - this is the ":actionSelector": ".ids-accordion-item" part
  • generate 2 variants, one with :tap, one without. This is specified by the following part:
"variantProperties": [
    ":tap"
  ]

Now in the case of your component I do not think you need to use the :actionSelector configuration, because by default story.to.design tries to look for elements it can interact with such as buttons, which your component does contain, so it should use it by default I believe

This should actually completely remove the need to use advanced variants at all - you should be able to just do (unless you had another reason to use advanced variants):

image

Can you help me understand your use case? Don't hesitate to reach out on Discord if you prefer 👍 (my login is remy.masson, on https://story.to.design/chat)

@andreeeabb
Copy link
Author

andreeeabb commented Apr 11, 2024 via email

@muryoh
Copy link
Member

muryoh commented Apr 11, 2024

Hi @andreeeabb,

I replied in #165 as it seemed specific to this one. Let me know if there is still something I can help with for that specific component (which is not full page but just an accordion)

Best regards
Remy

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

2 participants