Skip to content

Commit 34df803

Browse files
committed
Ensure input take available space, but not more.
`flex-grow` will stretch the input to take all remaining space, but We need to ensure a small amount of space so there's room to type input. We'll set the input to "hidden" (via width: 0) when the dropdown is closed, to prevent adding a "blank" line (see: sagalbot#512). In that case, the flex-grow will still stretch the input to take any available space, on the same "line." This really needs sagalbot#512 to work best.
1 parent a5555a6 commit 34df803

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/components/Select.vue

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,11 +210,20 @@
210210
outline: none;
211211
margin: 0;
212212
padding: 0 .5em;
213-
width: 10em;
214213
max-width: 100%;
215214
background: none;
216215
position: relative;
217216
box-shadow: none;
217+
218+
/* `flex-grow` will stretch the input to take all remaining space, but We
219+
need to ensure a small amount of space so there's room to type input. We'll
220+
set the input to "hidden" (via width: 0) when the dropdown is closed, to
221+
prevent adding a "blank" line (see: https://github.com/sagalbot/vue-select/pull/512).
222+
In that case, the flex-grow will still stretch the input to take any
223+
available space, on the same "line."
224+
*/
225+
flex-grow: 1;
226+
width: 4em;
218227
}
219228
.v-select.unsearchable input[type="search"] {
220229
opacity: 0;

0 commit comments

Comments
 (0)