I am trying to create a fixed element with dynamic height, meaning its size changes when the browser window is resized. You can see an example of what I'm talking about here: https://stackblitz.com/edit/react-yuqarh?file=demo.tsx
This element acts like a menu and should:
- open automatically on first load (working)
- hide when the user clicks "hide" (partially working)
- open when the user clicks on a menu icon (working)
When the element is hidden, I use a negative bottom value to hide it. However, this value remains fixed even as the height of the element changes due to browser resizing, causing the element to disappear.
Just to clarify, this element is actually a search component with some input fields, but I've simplified it for this example.