Is there any way that I can highlight which button the user has pressed? As in the image below you can see that I pressed the four(4th) button and I want that the button which was pressed(which was four in my case) the last time should be highlighted. When I press/click the button it changes showing that it has been pressed/being pressed. something like that, is it possible in glide somehow, I have searched for some javascript option but haven’t succeeded yet.
Note: I know about the accent option in the button block but that only gives you the left, right, or none option but not the currently/last pressed.
The only way I can think of to do this with buttons would be to have two of every button (separate button components) - one with the accent colour and one without. And then use visibility conditions to hide or show the appropriate ones. Quite complex and messy to setup, but should work.
An alternative option would be to use a Collection and configure the item click actions to behave like buttons, and use an image with the collection to indicate the most recent one clicked.
this sounds interesting although would be helpful to see how to do this.
All I want to do is to have a favorite button change to UnFavorite when pressed on a details screen. I have this working when the button is on a collection item but would like to learn how to create the same behavior on details. thanks
Assuming that your favourites are stored in a user specific boolean column, then all you need is an action that toggles the state of that column.
So you’d have an action with a conditional branch something like:
- If Favourite is not checked, then Set Column Values → Favourite →
true
- Else Set Column Values → Favourite → Clear value
Alternatively, if your button has a unique label it can be achieved via CSS if your plan supports it.
Thanks Darren. I am using the “updated trebuchet method” to store my favorites - not the boolean method.
I got the button to change state by adding two button components and using visibility to determine which button to show if the item was favorited.