Auto-Show (select) first item in RG on page load?

Hi, I have 1 RG and am trying to get it so on page load it auto-toggles the first item in the list (since I have the RG setup as an accordion). Just so this indicates to the user that these are toggles and influences them to use the other drop-downs.

Does anyone know how I can accomplish this?

I tried some conditions and custom states, but I cannot seem to get it working the way I need - orderavideo | Bubble Editor

Whatever condition you’re using to expand the item in the accordion, just set that to a default on page load.

Ah… I see… you’re not using any conditions… you’re just using a toggle action.

You can still do this easily, just by adding a condition to the Answer group, when the current cell index is 1 this element is visible: yes.

1 Like

Thanks so much! That worked great!

Quick followup, is there a way to make it so when the user clicks on a different question and that toggles, to have it close the answer that is currently open? So, there is only one answer open at a time?

Yeah, it’s simple, but you’ll need to change the way you’re currently doing things.

You don’t want to use a Toggle action - instead you’ll need to use a custom state and a condition.

Just create a custom state somewhere (anywhere on, or outside the RG - but NOT inside it).

The type should be the same type as the RG (or it can be Number)

Have a condition on your Answer group that when custom state value IS the parent group's thing (or the current cell's index if using numbers) element is visible: yes

Then just add a workflow action to set the custom state to the the current cell’s thing (or index) whenever the relevant element is clicked.

1 Like

Thanks so much! That worked great!

1 Like