Change colour of single repeating group cell

Hello all

I have a repeating group, I want that when I click on one cell, the colour of that cell changes so that it stands out from the rest of the cells. To accomplish this, I created a yes/no custom state, and set it that when the group in that repeating group cell is clicked it changes the custom state from no to yes, and I added a condition that when custom state = yes the background colour of the repeating group cell group changes.

That is all fine but the problem is when I then select a different cell, how do I get the previously selected cell to return to its original colour?

1 Like

Instead of using custom states on the repeating group cells, use a page-level custom state (not in the repeating group) of type number. When a cell is clicked, set it to current cell index. On the cell, use a conditional When current cell index = custom state > change color.

1 Like

Hi thanks for the response. I have followed your steps but when I get to

after I select “When current cell index” firstly a “=” doesn’t show, only “is” and secondly the custom state doesn’t appear either as an option

Is and = are interchangeable, Bubble uses both, so dont worry.

The custom state wont appear directly, you have to first select the element you saved the custom state on.

So the complete expression would be
current cell index is element’s custom state

1 Like

Perfect, I got it to work, thanks man!

This topic was automatically closed after 70 days. New replies are no longer allowed.