JSFiddle - React, Tailwind, and code Playground
HTML
<div class="main">
<div class="event-list">
<div class="event t0900" data-popover-toggle>
<span>Important Meeting</span>
<div class="popover">Absolutely positioned element which should scroll vertically with parent and not be partially hidden.</div>
</div>
<div class="event t0600 popover-open" data-popover-toggle>
<span>Wake up - important meeting today</span>
<div class="popover">Absolutely positioned element which should scroll vertically with parent and not be partially hidden.</div>
</div>
</div>
</div>
CSS
.main {
border: 1px dotted #000;
height: 400px;
width: 350px;
overflow-x: visible;
overflow-y: auto;
}
.event-list {
position: relative;
height: 480px;
width: 350px;
}
.event {
margin: 10px;
padding: 3px 7px;
width: 330px;
box-sizing: border-box;
border: 1px solid #AAA;
position: absolute;
cursor: pointer;
}
.popover {
display: none;
position: absolute;
top: 100%;
left: 10px;
margin-top: 8px;
padding: 3px 7px;
width: 400px;
border: 1px solid green;
background-color: #FFF;
color: green;
font-size: 80%;
cursor: default;
}
.event.popover-open .popover {
display: block;
}
.popover:before {
content: '';
position: absolute;
top: -6px;
left: 7px;
width: 0px;
height: 0px;
border-style: solid;
border-width: 0 5px 5px 5px;
border-color: transparent transparent green transparent;
}
.t0000 { top: 0px; }
.t0100 { top: 20px; }
.t0200 { top: 40px; }
.t0300 { top: 60px; }
.t0400 { top: 80px; }
.t0500 { top: 100px; }
.t0600 { top: 120px; }
.t0700 { top: 140px; }
.t0800 { top: 160px; }
.t0900 { top: 180px; }
JavaScript
$(document.body).on('click', '[data-popover-toggle]', function(e){
$('.popover-open').not(this).removeClass('popover-open');
$(this).toggleClass('popover-open');
e.preventDefault();
});