algolia / instantsearch-ios

⚡️ A library of widgets and helpers to build instant-search applications on iOS.
https://www.algolia.com/doc/guides/building-search-ui/what-is-instantsearch/ios/
Apache License 2.0
595 stars 58 forks source link

Empty queries conditional display not working in HitsObservableController #266

Closed NicFontana closed 1 year ago

NicFontana commented 1 year ago

Describe the bug 🐛 HitsObservableController shows empty query search results even when HitsInteractor is initialised with showItemsOnEmptyQuery to false.

To Reproduce 🔍 Just follow the SwiftUI getting started guide, but initialise the HitsInteractor with showItemsOnEmptyQuery: false:

self.hitsInteractor = .init(showItemsOnEmptyQuery: false)

Expected behavior 💭 I expect to see the noResults SwiftUI view when the query is empty, but I see the results list instead.

Environment: