For an better UX i want to show an empty state when there are no items in the list. But i only can find the condition that the (vertical) list :count is 0. I can show the empty state on that condition but the list is always :count 0 when it is shown the firsttime and I use filter options for showing the right items in the list, so when i toggle between the filter options the list is also empty for an second an then the items are shown. So the empty state is show..hide
That is not an nice UX. Does anybody knows how to fix this? there is no loading state on the list items that i can use in the condition.
hat flicker happens because when you switch filters the list clears for a moment before the new data loads. during that moment count is 0 becomes true, so your empty state shows and then disappears.
don’t rely only on count. add a custom state like “loading”. set it to yes when a filter changes, and back to no once the list finishes updating (you can use a short delay if needed). then show the empty state only when count is 0 and loading is no.
that way it only shows when the list is truly empty, not while it’s refreshing.
Thanks! It almost works. However, when I change the filter, sometimes the list and the empty state appear at the same time. This only happens for about a second, and then the empty state disappears. I currently show the empty state only when the count = 0 and the Loading (CS) is “no”. I suspect these conditions aren’t 100% reliable on mobile.
i hope bubble implements an better default state that can be used for loading/empty states.