commerce
commerce copied to clipboard
Search page loading state does not reappear after initial search
Searching for something in the search bar will take you to the /search route and show the loading state. However, further searches from the /search route do not show the loading state again. It is more of an issue. on slower internet devices where it would seem as if the webpage is stuck since there is no indicator otherwise to show it is fetching data in the background and getting new results
Any way to force the loading state again after the search parameter in the URL changes?
I have Chrome throttled to 100 kbit/s in this video. I think I see what you're talking about here. You'll see when I switch from shirt
to hat
, the titles on the cards change nearly instantly, but the pics take a few seconds to reload with the right images.
Is this what you're seeing or something different?
https://github.com/vercel/commerce/assets/446260/9ec02872-c1b3-4dc5-a751-813d3e954451
When you initially go to shirt
, there is a loading skeleton, as seen in the photo. However, going from shirt
to hat
, it doesn't reappear. If fixed, it would solve the issue of reloading with the correct images.
IMO, a skeleton should reappear every time the search param changes like shirt
to hat
We'll likely move to this pattern: https://buildui.com/posts/instant-search-params-with-react-server-components