Skip to content

Long label issue on dropdown menu #714

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
edionmelarosa opened this issue Dec 14, 2018 · 3 comments · May be fixed by #1530
Open

Long label issue on dropdown menu #714

edionmelarosa opened this issue Dec 14, 2018 · 3 comments · May be fixed by #1530

Comments

@edionmelarosa
Copy link

The issue shows up when a label text is longer than dropdown menu width.

see replication here:

https://codepen.io/edionme-apdian-gubalane/pen/roxrgq

@antonkru
Copy link

antonkru commented Feb 6, 2019

Not a good solution. The issue is that blue background is only the width of the visible area and the text is white. So this issue does not happen for wide items that are not highlighted in blue.

@sagalbot sagalbot added the ui label Mar 9, 2019
@sagalbot sagalbot self-assigned this May 3, 2019
@dvdbng
Copy link

dvdbng commented Jun 27, 2019

There are a couple of CSS workarounds this issue, one is to make the parent a flex container and make the children have min-width: 100%:

.vs__dropdown-menu {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.vs__dropdown-option {
  min-width: 100%;
}

The other is to make the options display: table

.vs__dropdown-option {
  display: table;
  min-width: 100%;
}

I haven't figured out a way to make all of the options the same width (the width of the longest element) so that the blue thing always covers until the end of the selected element without changing the markup, but at least this way you see the whole element

@sebix
Copy link

sebix commented Jun 27, 2024

I'm using this to wrap the option's texts:

.vs__dropdown-option {
    overflow-wrap: anywhere;
    white-space: initial;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants