I have a gallery which is set to filter items from a SharePoint list based on a column which will contain a text value of either "a" or "b". The filter points to a global variable, with expectation that by changing the global variable from a to b, my gallery should then switch to showing all the entries where the filtered column = b.
And that happens... most of the time.
The setup is across 2 pages. One the first are two buttons, one setting the variable to a then turning to the gallery page, and the other setting b.
If I press the a button, the page turns and the filter is correctly appliedthe first time only.
If I go back and select the b button, it still shows a in the gallery. If I then go back and press the same b button again, so basically pressing the same button a second time, the filter is now correctly applied.
Same the other way around too, so basically I think the behavior I'm seeing is that with my gallery set to filter on the value of a global variable, I have to set that global variable twice (to the same value) before the gallery will update the filter.
I tried in classic and improved rendering just in case - both the same.
For now I've worked around it by having two copies of the gallery, each permanently set to either a or b, and instead of changing the filter I just hide or show one or the other. So my new app can go live! But would be good to understand what's happening.