When applying overflow-y-auto to a page it allows whole page to scroll instead of only a component
Tried finding more in depth solutions online, but to no avail
<div className="page-container h-full">
<div className="parent-container h-full">
<div className="apply-scroll-here overflow-y-auto">
</div>
</div>
2
Answers
Seems like the solution to this is to apply flex-col on the page container and flex-1 and overflow hidden of direct parent of the scrolling child component
To make the
apply-scroll-here
element the only element that is scrollable, you can set the overflow property of theparent-container
element tooverflow-y:hidden
. This will hide the vertical scrollbar for the parent-container element, but it will still allow theapply-scroll-here
element to have a vertical scrollbar.