question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Feature Request] v-select auto width depending of content

See original GitHub issue

Problem to solve

It would allow for a better flow of content depending of the usage and better UI overall.

Proposed solution

<v-select
    :items="$i18n.locales"
    :item-value="code"
    :to="switchLocalePath(locale)"
    v-model="locale"
    class="pa-0 ma-0"
    item-text="name"
    hide-details
    single-line
    dense
    autowidth
  />

image image

Check google sign in page at the bottom.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:15
  • Comments:24 (4 by maintainers)

github_iconTop GitHub Comments

24reactions
Flamencocommented, Apr 10, 2021

So using the current version of Vuetify (2.4.5), here is what works for me.

Add a class to the select to indicate a fit style.

<v-select class='fit' />

Create the following CSS to target the select element. The text-overflow value will prevent a pesky ellipsis.

.v-select.fit {
  width: min-content;
}
.v-select.fit  .v-select__selection--comma {
    text-overflow: unset;
}
Screen Shot 2021-04-10 at 11 22 07 AM Screen Shot 2021-04-10 at 11 22 12 AM
22reactions
arnaldoperezcommented, Oct 26, 2019

Besides de CSS trick .v-select__selections input { display: none} I also put the v-select insde a v-col and set its cols="auto". Works great!!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Vuetify v-select component width changing - Stack Overflow
The basic problem is that v-select has some styling (specifically padding and margin) that does not work very well at small widths.
Read more >
Auto resize select tag element width according to option
In this blog I will explain about Auto resize select tag element width according to option.
Read more >
Autocomplete component - Vuetify
The v-autocomplete component offers simple and flexible type-ahead functionality. This is useful when searching large sets of data or even ...
Read more >
Cap Value (FTM-V) Select UMA Foundry Partners LLC
Morgan Stanley investment advisory programs may require a minimum asset level and, depending on your specific investment objectives and financial position, may ...
Read more >
IBM Security AppScan Standard: User Guide
In order for AppScan to execute Adobe Flash content during scanning, you must have a ... automatically creates a test (or tests) based...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found