in Education by
As you can see on jsfiddle bellow, I'm using a vue component called Vue Multiselect. When the text of a multiselect is bigger then its width, the height of the multiselect increases to fit the text. I would like to maintain it in one line without increasing the height nor the width. https://jsfiddle.net/uweL9zap/1/ HTML:
JS: new Vue({ components: { Multiselect: window.VueMultiselect.default }, data: { value: { language: 'JavaScript teste teste teste', library: 'Vue-Multiselect' }, options: [ { language: 'JavaScript teste teste teste', library: 'Vue.js' }, { language: 'JavaScript teste teste teste', library: 'Vue-Multiselect' }, { language: 'JavaScript teste teste teste', library: 'Vuelidate' } ] }, methods: { customLabel (option) { return `${option.library} - ${option.language}` } } }).$mount('#app') CSS: * { font-family: 'Lato', 'Avenir', sans-serif; } .multiselect { width: 300px; } JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
If you simply want to cut the text you could add the following css: .multiselect__single { white-space: nowrap; overflow: hidden; } white-space: nowrap will avoid the line breaks and overflow: hidden just hides the overlapping text. The wdith and height of the select will stay the same as before. Here you can see it in action: https://jsfiddle.net/f7at84y6/

Related questions

0 votes
    I have hours trying to figure out how to avoid this bullet points at the bottom being cutted when the ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 2, 2022 in Education by JackTerrance
0 votes
    I have hours trying to figure out how to avoid this bullet points at the bottom being cutted when the ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 2, 2022 in Education by JackTerrance
0 votes
    I can't make td "Date" to have fixed height. If there is less in Body section td Date element ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 20, 2022 in Education by JackTerrance
0 votes
    I can't make td "Date" to have fixed height. If there is less in Body section td Date element ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 19, 2022 in Education by JackTerrance
0 votes
    My context IINM, the percentage-height assumes that he height of the parent is available when the height is ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 8, 2022 in Education by JackTerrance
0 votes
    I have a Div element that pops up when clicking on a icon. This works fine on desktop. But when ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 3, 2022 in Education by JackTerrance
0 votes
    I am working on a code pen and am having an issue where initially my main element would be exactly ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 26, 2022 in Education by JackTerrance
0 votes
    As I tried to add a video on my top-wrapper previously. (Thank you so much for those who leave ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 9, 2022 in Education by JackTerrance
0 votes
    I've got the following html Title News 10. April 2011 First News 09. Feb. 2011 Second News With ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 23, 2022 in Education by JackTerrance
0 votes
    I have following code and I want to get data from service. I have set everything from what I get ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 19, 2022 in Education by JackTerrance
0 votes
    How can i wrap data in the table. Currently if template name is too long i get a scroll bar. I ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 19, 2022 in Education by JackTerrance
0 votes
    I have following code and I want to get data from service. I have set everything from what I get ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 12, 2022 in Education by JackTerrance
0 votes
    I want to display the label of an input inside its input, so that when I click the input, the ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 3, 2022 in Education by JackTerrance
0 votes
    I have created floating label in input field.In chrome view is working fine, but not properly viewed in ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 2, 2022 in Education by JackTerrance
0 votes
    This question already has answers here: How to remove the space between inline/inline-block elements? (41 ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 7, 2022 in Education by JackTerrance
...