Hey Stephan,
Thanks for your message!
So I have a repeating group with a list of things and each of them have a button at the right to open a popup in order to change the thing’s title and emoji.
When I click on the button, it opens up the popup and populates the current thing’s data in the popup so I can see the correct title and emoji.
When I click on a placeholder text, the emoji picker is showing so I can select the new emoji I want to use. Then I click on save so I save the emoji to the thing in my data.
After that, if I want to edit another thing, I click on the edit button again and the popup is opening again.
That’s where the issue is: Opening the edit popup again shows the same emoji I picked previously instead of showing nothing for example, even if I didn’t select another emoji yet.
The emoji is showing because the placeholder has this condition: If the emoji picker has an emoji selected, then show the emoji, but if no emoji is selected then show the text “select an emoji”. And there is no action to reset the emoji picker, so when we pick an emoji it keeps this emoji selected.
When I click on the edit button, these actions are followed:
- Show popup
- Reset popup because I want to be sure to remove all data from the previous thing
- Display Data for the current thing I want to edit
I wanted to be able to add an action after those that “resets the emoji picker”
My workaround with custom state is this one:
When opening the popup, after displaying data for the current thing, I also sets a state called “emoji” with a type of “text” as blank on this popup. (so this state is blank)
So now, the default emoji is empty because the emoji showing in the popup is the one saved in this state, and as every time I open the popup the state is reset, I’m not having the issue I described before where I always see the emoji even if this thing shouldn’t have any selected yet.
And I have another workflow that sets the emoji in the state when an emoji is selected.
Sorry for not sharing a video or photos, but I tried to describe it as best as I can so I hope this helps!
Thanks!