I'm having this issue with a Lightning Web Component in Salesforce, but I think the root of it is universal.
I have a container div which houses row divs showing select/combobox fields, which I need to have hang over the top/bottom of the container when selected. I can get this by setting overflow:visible on the container.

I can add more rows and the container expands normally:

But what I want to do is add y-axis scroll bars when the container reaches a max-height. By definition, overflow:visible doesn't add scroll bars and the contents flow out the bottom of the container

Any ideas would be appreciated.