Cms dynamic filter with custom code : how to do a complexe button?

Hi, I’ve found a custom code that work with simple button but not when I add an icon on custom code.
The problem is : a div is created to embed the icon + text and JS can’t consider this div as part of the button. So the text and icon aren’t clickable.

I tried :

  • Z-index negatif on div
  • pointer-events none
  • disabled true
  • create a simple button and place on top of the icon button and link both so you click on the first and the second is considered checked

I think I need a little help.

Here is my site Read-Only: [LINK][1]
and the published site to see the JS working test-2

Hi Marine, welcome to the forum.

Are you trying to do this as a code embed because of the data-filter custom attribute? I may have a better option for you that will let you design your button using the designer, and still get that CMS custom attribute.

However I don’t think that’s the cause of your issue here.

It’s difficult to debug things remotely, but I suspect this is your problem;

Here’s a breakdown of what I’m seeing;

Hi Michael!
Thank you for the answer :smiley:

You’re right, I am trying to do this as a code embed because i tried to messed up with custom attribute directly on element setting tab in Webflow but it doesn’t worked. Seem like I have homework to do.

I added space on the button custom code, I put the code section in // commentary, saved and tried but it doesn’t worked. I also tried to add the div in event target but it seem you can only have one target.

So next, I tried your tip to send everything to a parent element but I’m just a product designer with few notions of JS so I think I messed up the code because now, everything didn’t work :sweat_smile:
I read the isotope file but on each example they only have simple buttons…

Next step is to figure this parent element out or contact someone at isotope and ask them directly haha

But I am very grateful someone answer me, thank you :innocent:

Have a nice day,

Since you have an unusual construction here that’s tripping up Isotope, your best bet is to check in the forums there. But here’s an overview of what I think you’re needing in your code to make this work;