How To Make A Register Overflow
Desire to read the how-to? Proceed below!
—–
I recently ran into an odd overflow problem in Firefox, Safari and Edge. I had a simple flex cavalcade layout that needed to scroll on overflow. It looked great on Chrome of form, but wouldn't overflow on other browsers. The content would but expand to its total superlative and accident out the layout.
The Setup
The goal here was to create a list of content with a fixed header section above information technology. The listing content was of an unknown length and would need to whorl. To make things a picayune more complicated, there was some additional content intertwined in the container divs and this entire component was destined to be used in several places.
"Easy," I idea. I whipped upwardly a quickflex-direction: column; container with a fixed div for the heading content and an overflow div container with its overflow content under that.
I tested in Chrome – looks slap-up
I tested in Firefox and Safari – looks great.
I cleaned upwardly the lawmaking, submitted the PR, and marked my ticket Ready for QA. Done.
…until a calendar week later on when the problems ticket came in. Scrolling wasn't working in Firefox. …What?
The Results
Under sure circumstances overflow needs a little extra love. It turns out that there was a feature in the flexbox specification that added an implied minimum size for flex items. This characteristic was removed and so re-added dorsum into the spec at some betoken.
Lucky for the states, the set is an piece of cake one. Simply add min-height: 0; to the flex child that has our overflow container.
<div form="main-container"> // flex-direction: column; <div class="stock-still-container">Stock-still Container</div> // height: 100px; <div class="content-wrapper"> // min-height: 0; goes here <div class="overflow-container"> <div course="overflow-content"> Overflow Content </div> </div> </div> </div>
Smash! Done.
CodePen
Check out the code on CodePen.
Conclusion
It's a super simple ready to an oddball edge case that took me a number of hours to find a solution for. Hopefully this saves you a bunch of time and hair pulling.
Play around with the CodePen, modify things and make the cognition your ain. As always, if you have any comments or ideas to share, please leave them below or look me up on Twitter!
Source: https://moduscreate.com/blog/how-to-fix-overflow-issues-in-css-flex-layouts/
Posted by: florencefifended.blogspot.com

0 Response to "How To Make A Register Overflow"
Post a Comment