I'm trying to layout an html input field with two buttons to the right of it in a flexbox container. The behavior I want is that the buttons are fixed width and the input field grows/shrinks to fill the remaining space. I have it working fine until the screen shrinks to a certain size at which point the input field stops shrinking and the buttons get pushed off the screen to the right. This only seems to happen for input fields and not divs.
Here's the example html that demonstrates the issue:
<div class="container">
<input class="flexitem" placeholder="Fixed Item" />
<div class="fixeditem">Item 1</div>
<div class="fixeditem">Item 2</div>
</div>
and the css:
.container {
display: flex;
background-color: yellow;
padding: 5px;
margin-bottom: 10px;
}
.flexitem {
flex: 1 1 auto;
}
.fixeditem {
flex: 0 0 auto;
background-color: red;
margin: 0 2px;
}
The really strange part is that if I add a "width: 50px" to the flexitem class it works. It's like an input field has an implied minimum width.
Here's a plunkr that demonstrates the issue and "fix". plunkr
Anyone have an idea why this happens?