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

Bootstrap theme doesn't cut off text past border

Open lin1412 opened this issue 11 years ago • 17 comments

Hello, I'm using the ui-select with the bootstrap theme, but when I select an option that has an text past the input box size, the text doesn't cut off like the one in select2 theme.

cutoff

lin1412 avatar Feb 19 '15 16:02 lin1412

Here's how I fixed the issue .ui-select-bootstrap .ui-select-match-text > span { display: block; text-overflow: ellipsis; overflow: hidden; }

quietcodes avatar Feb 20 '15 16:02 quietcodes

thanks for the fix. This does solve the problem, but it also increases the select box's height when something is selected. To counter this, I had to set the height of .btn-select-white, which causes the location of the dropdown caret to be out of place. Tried changing the caret's margin-top, but a pristine select box and a selected select box have the caret at different locations.

If there another way where it doesn't change the input box's size, or another fix so the caret don't change location.

Thanks

lin1412 avatar Feb 20 '15 20:02 lin1412

I think my instance is inheriting a white-space: nowrap from somewhere. If you add that in, the text should keep to one line.

quietcodes avatar Feb 20 '15 20:02 quietcodes

this is how i fixed it:

.ui-select-toggle { &.btn { padding-right: 23px; } }

btm1 avatar Feb 24 '15 01:02 btm1

Fix is not working for me: http://plnkr.co/edit/7vHdHfhwZkw4x5lR6wTl?p=preview capture

Any idea why?

istibekesi avatar Apr 03 '15 12:04 istibekesi

I had the same problem as the pull-left on the ui-select-match-text element will cancel text-overflow. You can try:

.ui-select-match-text  {
  &.pull-left {
    float: none !important;
  }

  > span { 
     display: block; 
     text-overflow: ellipsis; 
     overflow: hidden; 
   }
}

exaptis avatar Apr 17 '15 18:04 exaptis

Can you please, fork my plunk and fix it?

istibekesi avatar Apr 20 '15 12:04 istibekesi

You'll find the css adjustment at the end of style.css

http://plnkr.co/edit/Qmxx7CHf3crnXxc8QXCk?p=preview

exaptis avatar Apr 20 '15 12:04 exaptis

Thanks, now it works fine!

istibekesi avatar Apr 20 '15 12:04 istibekesi

@exaptis Your fix has a problem with the allow-clear option

captura de pantalla 2015-05-08 a las 13 48 25

gerardp avatar May 08 '15 11:05 gerardp

@gerardp i found a quick-fix, but the solution is not pretty. ui-select does not provide a dedicated class for the clear icon :-(

http://plnkr.co/edit/Qmxx7CHf3crnXxc8QXCk?p=preview

  .ui-select-toggle > a.btn-link  {
    top: 6px;
    position: absolute;
    right: 20px;
  }

  .ui-select-match-text {
    margin-right: 35px;
  }

exaptis avatar May 08 '15 12:05 exaptis

@exaptis It works, thanks !!

gerardp avatar May 08 '15 12:05 gerardp

@lin1412 should this issue really be closed without pull-request? Because it is a bug in the stylesheet, therefore it should only be closed after the bug fix was merged. If you re-open this issue I'll provide a pull-request to fix it.

exaptis avatar May 11 '15 14:05 exaptis

hi, I am still having issue on this

-- html file image

-- css file .ui-select-bootstrap .ui-select-match-text > span { display: block !important; text-overflow: ellipsis!important; overflow: hidden!important; white-space: nowrap!important;}

jsudarman avatar May 11 '15 20:05 jsudarman

@jsudarman please provide a plnkr sample.

exaptis avatar May 11 '15 20:05 exaptis

http://plnkr.co/edit/NAkPOpGK7aqmgpZ8rrPE?p=preview

jsudarman avatar May 11 '15 21:05 jsudarman

@exaptis

.ui-select-match-text  {
  &.pull-left {
    float: none !important;
  }

  > span { 
     display: block; 
     text-overflow: ellipsis; 
     overflow: hidden; 
   }
}

didn't work for me too, but

.ui-select-toggle > a.btn-link  {
    top: 6px;
    position: absolute;
    right: 20px;
  }

  .ui-select-match-text {
    margin-right: 35px;
  }

actually worked. Can you help on that?

andrii-p avatar Aug 13 '15 22:08 andrii-p