I have a basic layout based on flexbox with one speciality. I have a navigation module that contains many elements and should scroll horizontally when the screen is too narrow to display all the element.
Everything works fine but not in Firefox. Here the navigation causes all its parents to be wider than the screen and produces a horizontal scrollbar for the whole page.
Below is my code. How can I get the same result in Firefox as I have it eg. in Chrome?
html,
body,
.view {
display: flex;
flex: 1;
width: 100%;
}
html {
height: 100vH;
}
body {
flex-direction: column;
margin: 0;
}
header {
background-color: red;
}
.content {
display: flex;
flex: 1;
}
.sidebar {
background-color: green;
flex: 0 0 10rem;
}
.list {
background-color: blue;
flex: 0 0 10rem;
}
.view {
flex-direction: column;
width: calc(100% - 20rem);
}
.selector {
display: flex;
background-color: yellow;
flex: 0 0 5rem;
overflow: auto;
}
.selector__item {
flex: none;
width: 300px;
height: 200px;
}
.selector__item:nth-of-type(odd) {
background: #cccc00;
}
.grid {
background-color: pink;
flex: 1;
}
<header>content</header>
<div class="content">
<div class="sidebar">
Sidebar
</div>
<div class="list">
List
</div>
<div class="view">
<div class="selector">
<div class="selector__item"></div>
<div class="selector__item"></div>
<div class="selector__item"></div>
<div class="selector__item"></div>
<div class="selector__item"></div>
<div class="selector__item"></div>
<div class="selector__item"></div>
<div class="selector__item"></div>
<div class="selector__item"></div>
<div class="selector__item"></div>
<div class="selector__item"></div>
<div class="selector__item"></div>
</div>
<div class="grid">
Grid
</div>
</div>
</div>