Hello everyone! This is my first time posting a question here, even though I've been relying on this site for solutions for several years now.
I've encountered a "multi-row" issue that seems to be unique and hasn't been covered yet. Despite searching extensively, I haven't come across a suitable solution for it.
My problem revolves around a CSS/HTML layout using Bootstrap 5.3. I have two rows that need to span the entire container, almost covering the entire viewport. The first row grows using
flex-grow: 1!important; min-height: 0; overflow: hidden;
, which works well on wider screens. However, on smaller screens, I end up stretching the content across 24 columns within two displayed "subrows". As a result, the lower "subrow" becomes overly long as it still calculates its height based on the whole row's height.
Here's a simplified version of my code - please view the result in full window mode to avoid any messy display:
#root {
height: 100vh;
padding: .25rem;
}
.growing-row-overflow-hidden {
flex-grow: 1!important;
min-height: 0;
overflow: hidden;
}
.pianoroll {
overflow: hidden;
display: inline-block;
}
.notYetReady {
opacity: .5;
pointer-events: none;
}
<link href="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="3c5e5353484f484e5d4c7c09120f120c115d504c545d0d">[email protected]</a>/dist/css/bootstrap.min.css" rel="stylesheet"/>
<div id="root">
<div class="container-md text-center border h-100">
<div class="App h-100 d-flex flex-column">
<div class="row growing-row-overflow-hidden">
<div class="col-12 col-sm-6">
<div class="row h-100">
<div class="col-4 col-sm-12 flex-grow-1 list-group p-2 ">
<div class="list-group-item list-group-item-secondary text-uppercase">Record</div>
<div class="list-group-item h-100"><button
class="btn btn-outline-success w-100 h-100">Start</button></div>
</div>
<div class="col-4 col-sm-12 flex-grow-1 list-group p-2 notYetReady">
<div class="list-group-item list-group-item-secondary text-uppercase">Stop</div>
<div class="list-group-item h-100"><button
class="btn btn-outline-warning w-100 h-100">Stop</button></div>
</div>
<div class="col-4 col-sm-12 flex-grow-1 list-group p-2 ">
<div class="list-group-item list-group-item-secondary text-uppercase">Save</div>
<div class="list-group-item h-100"><button
class="btn btn-outline-primary w-100 h-100">Save</button></div>
</div>
</div>
</div>
<div class="col-12 col-sm-6 list-group p-2 h-100 ">
<div class="list-group-item list-group-item-secondary text-uppercase">Your Pitch</div>
<div class="list-group-item h-100 overflow-auto">
<div class="pianoroll">
<div style="height: 2000px; background-color: red">A lot of content...</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col list-group list-group-horizontal p-2">
<div class="list-group-item list-group-item-secondary text-uppercase">Sensitivity</div>
<div class="list-group-item w-100 d-flex"><span class="flex-fill"><input type="range"
class="form-range liveSensitivitySlider" style="--inputRMS:0%;"></span></div>
<div class="list-group-item"><button class="btn btn-outline-primary w-100 h-100">Settings</button></div>
</div>
</div>
</div>
</div>
</div>
If anyone has alternative suggestions on how to achieve this layout effectively, I'd appreciate the help. My goal is to have both rows fill the entire screen - whether it's in three displayed rows on small screens or two displayed rows on larger screens.
Your assistance would mean a lot to me!
Thank you,
Walle