So I’m back working on custom states.
I think I’ve read everything there is about clearing a custom state.
I’ve read to set the state and leave it blank and it will empty it. It does not.
I’ve read to just leave a space and it doesn’t work.
I think there should just be a ‘clear’ for the custom state.
So, maybe I’m overthinking this…
but can someone tell me how to clear a custom state?
I have a create a listing page and edit page and I need to clear the custom state after the listing is created or edited so when the next listing is created or edited it won’t still show the contents of the current state from before.
I just cannot figure this out.
So for anyone else with this problem…
I did go back and see there was a :minus list.
Not sure how I’ve overlooked it for so long.
1 Like
Hmm… I’ve do not recalling having issues with just setting states blank to clear them.
Do you have any default values set?
1 Like
the issue is that you’ve got a default in the state…
this catches me all the time. if you set a default in the state then when you “clear it” it refills it with the default which means that you can’t ever clear it
if you need a default then push it into the state on page load or button click. I never use state defaults due to this issue of not being able to clear them
the same is not true for fields… it’s one of those “bubble logic quirks” that doesn’t make any sense
1 Like
Actually, I have ‘on page load’ and I set the custom state.
Is that considered a default value?
I tried everything to clear it and then discovered the :minus list which is working.
Added: As far as leaving the state blank to clear it, it didn’t work. I also came across a couple of posts on the forum that said they had the same problem with just leaving it blank.
1 Like
ah yes, there is an issue with the “clear list” and leaving a list empty you have to use minus list
I had a similar issue with clearing a list on a data field - had to use set list to blank instead of clear list
1 Like
Ah okay! Yeah that’s an issue I experience too.
What I always do is use a blank list state (of relevant type) and point the state list I’m updating to that.