In the process of developing a react application, I have encountered an issue with an off-canvas bar. This off-canvas bar is outlined in green and positioned absolutely within the UI kit. Inside this bar, there are three divs - 'A', 'B', and 'C'. The heights of 'B' and 'C' divs are subject to change dynamically.
My objective is to prevent scrolling on both the off-canvas bar (green border div) and the 'C' div when content is added to 'B' and 'C'. The only scrollable area should be within the 'B' div. Unfortunately, setting fixed heights for 'B' and 'C' divs is not a viable option due to their variable heights. Even attempting to calculate 'C' div's height using JavaScript has proven unsuccessful.
Edit
Your code snippet:
.secondary-offcanvas .uk-offcanvas-bar {
padding: 0;
width: 480px;
border: 1px solid var(--border-gray);
position: absolute;
box-sizing: border-box;
top: 0;
bottom: 0;
display: flex;
flex-direction: column;
overflow-y: hidden;
}
B div styling:
.shopping-cart-details {
overflow-y: auto;
flex-grow: 1;
}
Current Issue: While the parent div no longer scrolls as intended, the 'B' div remains unable to scroll properly. As a result, the excess content within the 'B' div gets cut off.