I've made a search box with auto-suggestions. I don't want to have the suggestions push down the other elements on the page.
What I did to fix this:
I gave the suggestions position: fixed
and added a window event listener to update its top
and left
on scroll, to make it appear as if it's dropping down from the search box.
This is quite obviously not a good way to achieve this at all. Can anyone give pointers on how to improve this, please? Thanks!