I am facing an issue with a container that has a set overflow-y: scroll property. Within this container, I have multiple elements including a dropdown menu. The challenge lies in ensuring that the dropdown menu can overflow the container as needed. Despite setting its position to absolute, it seems to be relative to elements within the container rather than the container itself.
Here is the CSS for the container:
.container {
position: static;
border-radius: 24px;
box-shadow: 0px 0px 12px rgba(0,71,255,0.4);
padding: 2rem;
margin: 1rem;
width: 100%;
overflow-y: scroll;
max-height: 55dvh;
}
CSS for the dropdown menu:
.dropdownmenu {
z-index: 1000;
max-height: 400px;
overflow-y: scroll;
direction: ltr;
opacity: 0.9;
position: absolute;
margin-top: 8px;
border: none;
border-radius: 24px !important;
display: flex;
flex-direction: column;
width: 95%;
}
It is important to note that there are multiple layers of elements within the container, causing the position:absolute property to be relative to inner elements rather than the container itself. This structure needs to remain intact.