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.

[QSelect] Enhancement: Add option to truncate long labels

See original GitHub issue

Is 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:

Screenshot 2019-11-28 at 18 21 58 Screenshot 2019-11-28 at 18 22 26 Screenshot 2019-11-28 at 18 35 09

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:18 (6 by maintainers)

github_iconTop GitHub Comments

4reactions
hawkeye64commented, Jan 23, 2021

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-truncate prop. I think there is a high number of people who would want this over those who don’t.

4reactions
hawkeye64commented, Nov 29, 2019

Can this also be added to other components that may need it? Like QBtn and family? Using slots every time is tedious compared to truncate and label props.

Read more comments on GitHub >

github_iconTop 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 >

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