[QSelect] Enhancement: Add option to truncate long labels
See original GitHub issueIs your feature request related to a problem? Please describe. When the label of a QSelect item is longer than the QSelect itself, the label is wrapped on multiple lines.
Describe the solution you’d like
I’d like to have an option to truncate long labels. This could e.g. be handled with an additional attribute truncate which could be added to the <q-select>:
<q-select
label="Options"
:options="[
{label: 'Please choose', value: '', disable: true},
{label: 'Option 1 (which has a pretty long label)', value: '1'},
{label: 'Option 2', value: '2'}
]"
truncate
>
As far as I have tested this, it should be pretty simple as it seems that adding the Quasar CSS Visibility class ellipsis to the <span> that wraps the label text already results in the desired behaviour:
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:18 (6 by maintainers)
Top Results From Across the Web
[QSelect] Enhancement: Add option to truncate long labels
[QSelect] Enhancement: Add option to truncate long labels. ... When the label of a QSelect item is longer than the QSelect itself, the...
Read more >q-select with input and large option label - Quasar forum
Hi. Is there an option to apply some kind of ellipsis to a selected label option in q-select? When you have a label...
Read more >Truncating canvas labels in ChartJS while keeping the full ...
In Chart JS V2 you can truncate labels passing the options object. Also you can customize the tooltips. options:{ scales: { xAxes: [{...
Read more >Using Quick Select - - Users Guide - Appeon Documentation
The easiest way to define a data source is using Quick Select. ... To use these options when you create a report, choose...
Read more >REDCap Change Log - Eastern Virginia Medical School
Fixed issue with choice labels that have commas in them getting cut off. ... being truncated (and thus corrupted) when being added to...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I personally think components should always handle truncation in an elegant way and if someone does not want it, then there would be a
no-truncateprop. I think there is a high number of people who would want this over those who don’t.Can this also be added to other components that may need it? Like QBtn and family? Using slots every time is tedious compared to
truncateandlabelprops.