fix(autocomplete): hide header when there are no items to display#6883
fix(autocomplete): hide header when there are no items to display#6883FabienMotte merged 3 commits intomasterfrom
Conversation
Haroenv
left a comment
There was a problem hiding this comment.
fix looks good, can you add a test?
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 2db7a3f:
|
Haroenv
left a comment
There was a problem hiding this comment.
so the issue is that unlike other sources, which only render if there are results, recent searches is rendered, and therefore renders the header. This feels like a correct fix, but alternatively we also could have made the whole recent searches source conditional based on the items, and not just the header, as we now are still rendering the parent div.
Good point, should I also add a condition to only display the "Recent searches" source when there are items to show? |
681ca91 to
2db7a3f
Compare
Summary
This PR fixes the
headerComponentbeing displayed even when there are no items, such as when usingshowRecent.headerComponentwithout any recent searches.Result
Before
After