vue-select icon indicating copy to clipboard operation
vue-select copied to clipboard

Line breaks in options slot

Open bttger opened this issue 4 years ago • 1 comments

Is your feature request related to a problem? Please describe. If having long option labels the dropdown starts to look bad because of the overflow. See the following picture:

image

Describe the solution you'd like It would look much better to have line breaks in the options slot by default and thus not having the horizontal overflow and scrolling. I believe that this is quite a common problem.

My current solution through the option slot is:

<template #option="option">
  <div style="white-space: normal; vertical-align: top; display: inline-block; line-break: loose; overflow-wrap: anywhere;">
    <p style="margin: 0;">
      {{ option.label }}
    </p>
  </div>
</template>

We are breaking lines with the 'loose' rule and if any word is longer than the whole inline-block, then we break it with the overflow-wrap: anywhere rule.

image

bttger avatar Jul 08 '21 13:07 bttger

Looking a lot better https://deploy-preview-1530--vueselect.netlify.app/guide/css.html#option-wrapping-strategy

sagalbot avatar Oct 22 '21 19:10 sagalbot