No Switch Press event handler for list collection Switch action type?

One of the action types of the List Collection component is the Switch action, which display a toggle switch on the right side of every item in a list collection, as shown below:

This has been available for a while now, but every time I try to use it, I run into the same issue. It's a functional toggle that lacks an associated event handler. It can be used to indicate the on/off (true/false) value of an item, but it cannot be used to change it.

It cannot be used because there doesn't seem to be an option for "Switch Press" in the event handler configuration dropdown menu. See screenshot below:

I can create event handler for Press, Button press, Checkbox press, but not Switch press.

Is this intentional or has it slipped through the cracks? It would be really helpful to have this working properly, as it's a potentially very useful feature that is not really usable due to this omission.

Thanks.

@Tess, thank you for looking into this.

On a similar note, it may be worth looking at the rest of the options of the List collection. A collection can be configured with an image or an icon as media, but a dedicated event handler is not available for either.

It would be useful to also have an icon press event handler for either left, right or both possible icons of any list item.

retool_list_icons

Here's an example:

Thanks.

Thanks for the feedback here @27shutterclicks! I've filed your request for the mobile team to take a look at and will report back here on it :slightly_smiling_face:

It sounds like you've been doing a lot with the mobile editor already but just to double-check - have you been able to recreate the behavior you're looking for using custom collections? Is that connected to the padding issue you describe here?

Indeed, the padding issue described in the other thread prevents me from achieving the behavior I need using custom collections.

Even if it didn't, recreating all the exact elements and layout using custom collections would be wasteful time-wise, given that almost everything needed exists as part of the List collection.

As I see it, I should make use of a custom collection to make something "custom", not to replicate the exact layout of the list collection, only to gain event handlers, which should exist anyway as part of the list collection.

@Kabirdas Actually, after checking, I did recreate it using custom collection, and accepted the current drawbacks:

  • The spacing is exaggerated, reducing the effective space available for text horizontally
  • The custom collection needed to be inside yet another container to gain additional control over padding, making it about 5 or 6 levels deep.
  • I now suffer from PCCRTAD (post custom collection recreation traumatic anxiety disorder) :slight_smile:

In list collections, the icon press options is also missing, I replaced icon with button for the time being

Thanks @rxunique, I've added your interest as a +1 on our internal request. Pressing an icon as an event handler is just not supported yet. Glad you found a workaround to replace the icon with a button for the time being! :bowing_man: Hopefully that workaround can help others who're aiming for the same functionality in the meantime. We'll update here if there's movement on implementing this in the product.