Hit just shows a custom anchor transformItems removes some unwanted results
Now, my problem is that when everything is loaded, it shows some search results out of the box. I also see a XHR request happening. Also, when I start typing (and refining the result), before the new results that match my query are shown, I see a flash of the default results. I would like to hide these default results.
Can anyone help me achieve this? This seems like a common feature someone would want, but please let me know if you need more information.
NoResults is for just that – when a user performs a search and there are no matching results returned.
You want to suppress results for empty queries. That’s documented here:
You need a conditional to check if the query is empty in the UI state and act accordingly.
Note that if you do wish to suppress the results, we recommend replacing them with an initial state with query suggestions or popular items to give users something with to engage with immediately.
I’ve come a bit further now, using <EmptyQueryBoundary>. The default results are gone when there’s no query. It’s still not entirely how I would like things to work though.
There’s 1 problem left. The default results are still flashing when I’m simulating e.g. slow 3G and typing a new search phrase. Is there any solution for that? Intercepting (hiding) these?
Thanks for your suggestion of popular items by the way. I was thinking of making this a setting. I will implement this!
Hmmm… we’ve gone beyond my front end knowledge here, I’ve reached out to our internal front end experts to see if they have any tips about avoiding flashing in the UI.
Hi @chuck.meyer, thanks again for your answer and thanks for the sandbox. I could actually reproduce it using the sandbox from your front-end developer.
As you can see at the end of the video at roughly 0:16, it happens. When searching for ‘c’: first, there is ‘Amazon’, ‘Google’, ‘Dell’ and a few frames later there’s ‘Dell’, ‘Apple’, ‘LG’. After this moment in the video, it keeps happening for other search terms.
Now, this video was recorded with a fast internet connection. It may not be noticeable for everyone, but it still ‘flickers’ with default results.
To demonstrate it in full detail, I’ve also captures a video using a slow 3G connection. I only started typing after everything was properly loaded and all connections were idle.
It’s kind of hard to explain what I see through text. I think these videos, using your developers sandbox, explain it perfectly.
I really hope I can remove this ‘default results flicker’ and am curious as to what you guys come up with!
EDIT: Re-uploaded the videos to WeTransfer due to expiry: videos
Thanks for re-uploading. Things slowed down around here during the holidays. Let me re-connect with the engineer internally and see if they have any further suggestions.
Just checked back in the internal system and didn’t see a response. I added another comment, but you may have more luck reaching out to the devs directly by cutting an issue on GitHub