Force child element to display outside overflow hidden container
I'm trying to solve this css problem: I have a list of items contained in a scrolling container (overflow-y: scroll / overflow-x: hidden) each of this items have a child div (popup). I need to display this child element outside the scrolling container but the position must be relative to the item div.
I can't manage to find a way to display those childs elements outside the overflow hidden of the scroll container.
If anyone has a solution, thank you so much.
Simplified exemple :
https://jsfiddle.net/zbvwjq1s/35/
.container{
position: relative;
background-color:black;
width:200px;
margin:0 auto;
}
.scroll-container{
overflow-y:scroll;
height: 250px;
background-color:red;
}
.item{
display:flex;
align-items:center;
margin-top: 10px;
width:100%;
height: 50px;
background-color:green;
}
.popup {
position: absolute;
right:-80px;
width:80px;
height:40px;
background-color:blue;
visibility:hidden;
}
.item:hover .popup {
visibility:visible;
}
<div class='container'>
<div class='scroll-container'>
<div class='item'>
<div class='popup'></div>
</div>
<div class='item'>
<div class='popup'></div>
</div>
<div class='item'>
<div class='popup'></div>
</div>
<div class='item'>
<div class='popup'></div>
</div>
<div class='item'>
<div class='popup'></div>
</div>
<div class='item'>
<div class='popup'></div>
</div>
<div class='item'>
<div class='popup'></div>
</div>
</div>
</div>