Replicating the Algolia documentation search with Autocomplete

Hello Community

I’m a junior developer and I’ve been following this arcticle Replicating the Algolia documentation search with Autocomplete you guys published on your blog.

The only difference between my implementation and the one in the article is that I used React.

I implemented mine using the article and the docs (Using Autocomplete with React | Algolia Documentation)

I’m actually facing 3 main issues which I saw wasn’t present in the final project on Codesandbox (@algolia/autocomplete-example-preview-panel-in-modal - CodeSandbox)

The issues I’m facing are:

1- When I write something in my input and click on the suggestions, the whole modal disappeared

autocomplete

2 - When I write something in my input and click on the X button like to clear out the input the whole modal disappears

autocomplete (1)

3 - When I write something in the input and then clear out everything using keyboard backspace, the right insight part (where we have the image, price and description) still stays.

autocomplete (2)

In my code I juste make use of 2 main components which are:

AlgoliaAutocomplete

Search

Pretty sure I missed something out and I’ll be really greteful if you guys can help me out.

Thanks and have a nice day!