Browser: Chrome 110 OS: macOS / Windows / Linux / etc. URL: Link to a page that illustrates this issue Video: Short screen recording that illustrates this issue (free tool: jam.dev)
Hi
I am trying to use interactions on a selected class, which I can add just fine, and it’s different options to the main element / ID. But when I click off them, they then disappear and don’t save on the element?
I have to do this, as I am trying to toggle a data-attribute based on a class - but it then toggles it on EACH class on that page each time any of them are in viewport (I don’t have to have to copy and paste the interaction to EACH element, it would take ages and be hard to scale).
at first, I thought this is 100% not a bug, and I’m still quite certain now as well. But, just to be sure, can you record a video on how to replicate the issue, and what is your setup?
Below are some comments:
Interaction should be store on the class.
Yes, because the selector is like that likely. You can’t really say “toggle on nearest element only” - you would need JS for that.
Yes I thought that, but it doesn’t save on the class - at all? It just saves to the ID/core element - it’s different for you?
I understand. I didn’t want it to toggle on nearest element, but I don’t want it to toggle classes that are not in the viewport - as in this instance, I am using the data-attribute to start/stop an animation. This won’t work as the attribute is added to all classes on that page, and as such, the animation fires on all of them - if that makes sense.
I wanted to add the interaction to the class so I can easily add/toggle this effect on elements without having to keep copying and pasting conditions from IDs.
It should be saved on the class (in builder), but on frontend, the interaction is still applied on all elements that have that class.
I will toggle everywhere that you target it, including the elements that are not in the viewport.
I think it’s best if you can record the video of your setup and what you want to achieve + show the issue, where the interaction is added to ID not the class.
That sounds like it could work, for sure, but the interaction was sticking to the class for me if you noticed in that video? Was that solely due to me setting it as class and not self though?
I’m sure I tried it with self first, and changed as nothing was saving to the class.
I think in this case is best if I take a look. If you can prepare a staging website or just a page and a class where I can check this, it would be best if can send temporary login credentials a link to this topic to help@bricksbuilder.io using the email address you used during the purchase, so we I take a look?
thank you for the email and access. It looks like there is an issue with adding interactions to classes and updating interactions that are set on classes.
I was able to replicate that issue as well on the local installation, and I’ve created an internal bug report.
We will fix this and once we do, we will update this topic. Until then, you will have to set interactions on ID level.