Select width changes according to the selected item #1246
-
Hello, I have a select with some items. Some of these could be pretty long and if users select them the select become longer. And if they select again a short item the select width changes again. How can I avoid this behaviour and have select with a fixed width? Here is my code: https://codepen.io/smartm0use_/pen/wvBPyEB |
Beta Was this translation helpful? Give feedback.
Replies: 7 comments
-
Adjust the CSS for the underlying .ui.fixed.dropdown .text {
width: 150px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
} |
Beta Was this translation helpful? Give feedback.
-
Could using "fixed" as class be an improvement for Fomantic-UI select/dropdown? |
Beta Was this translation helpful? Give feedback.
-
Maybe, but i am unsure about the fixed value. In my example i used 150px for testing purposes only |
Beta Was this translation helpful? Give feedback.
-
Unfortunately this breaks |
Beta Was this translation helpful? Give feedback.
-
Sure, thats the purpose of |
Beta Was this translation helpful? Give feedback.
-
Uhm, so in this case my request is always make ellipsis for text of the selected item that is longer than the select. Anyway avoid that the contect of select/dropdown change the size of the select/dropdown. |
Beta Was this translation helpful? Give feedback.
-
Closed since @lubber-de already provided the solution. Please feel free to reopen or create a separate issue if you've any feature request for this. |
Beta Was this translation helpful? Give feedback.
Adjust the CSS for the underlying
.text
according to your needs:See https://jsfiddle.net/4w26qvr9/