sickdyd / react-search-autocomplete

A search box that filters the provided array of objects
https://sickdyd.github.io/react-search-autocomplete
MIT License
218 stars 82 forks source link

How to overlay a component result 'react-search-autocomplete' on top of another component's element? #29

Closed taixe closed 2 years ago

taixe commented 2 years ago

Hi everybody? How to overlay a component result 'react-search-autocomplete' on top of another component's element? I get a error .

Screen Shot 2021-08-09 at 09 55 20
sickdyd commented 2 years ago

Hello @taixe,

I think that the problems is related to the z-index of the image/component below. What you can do is use a higher zIndex for the search component by passing the styling prop with zIndex.

In the example below I'm using 9999 but it's possible that the component covering the search box has a higher value, so you might want to figure out what's that value or increase zIndex until it's covered. Let me know if this helps:

styling={{ zIndex: "9999" }}
taixe commented 2 years ago

Thank @sickdyd . The problems clear with zIndex.