I am working on an Excel-like grid and am having trouble displaying a pop-up properly since the bottom appears cut-off by the container div.
The problem is very similar to CSS: How to have position:absolute div inside a position:relative div not be cropped by an overflow:hidden on a container and I am looking for similar results, but inside a containing div. I can achieve the layout I want without the containing viewport.
The basic layout & styling is:
<body>
<div class="viewport">
<div class="canvas">
<div class="rows">
<div class="row">
<div class="cell">
<div class="cell__Value">
<div>
<div class="popup">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
.viewport {
height: 150px;
width: 400px;
background-color: blue;
overflow: hidden;
position: absolute;
top: 35px;
}
.canvas {
height: 149px;
width: 399px;
background-color: lightblue;
overflow-y: scroll;
overflow-x: auto;
position: absolute;
}
.rows {
height: 100px;
width: 700px;
background-color: red;
overflow: hidden;
}
.row {
background-color: darkred;
height: 35px;
overflow: hidden;
}
.cell {
background-color: green;
position: absolute;
left: 100px;
width: 100px;
height: 35px;
overflow: visible;
}
.popup {
background-color: lightgreen;
opacity: 0.8;
position: relative;
width: 150px;
height: 200px;
}
I've created a mocked version using jsFiddle - http://jsfiddle.net/huf45f2h/2/, and I can't get it to work here either.
Essentially, the canvas must scroll y-overflow content so the grid rows are scrollable and do not fill the entire page. The pop-up in the fiddle is an informational div that should appear when a user clicks on a single cell. As the mock shows, the height of a large pop-up causes the viewport and canvas to scroll, rather than allowing the pop-up to appear on-top and partially outside of the viewport.
I attempted to follow the advice here - http://front-back.com/how-to-make-absolute-positioned-elements-overlap-their-overflow-hidden-parent, but to no avail. I have also tried floating the pop-up and increasing the z-index.
How can I display the pop-up as desired?