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

Not showing choices

Open softzer0 opened this issue 8 years ago • 15 comments

I think that I've discovered a bug particularly in my use-case because I'm (still) not able to reproduce it on Plunkr but I'm able to identify it manifesting on my page. I'm using the latest versions of Bootstrap, AngularJS (with ngSanitize of course) and UI Select. I've used the same code from the Basic example in Getting Started, and this is what I get when I put it on my website:

Screenshot

That happens when I click on caret to list all possible choices. You see that opacity (inline) CSS attribute is set to zero, which is odd because it has to be set to 1 in order for choices to be visible, so once I change the attribute value from 0 to 1, it starts to behave normally. And because that attribute is inline, there's no possibility that it's due to some conflict with my custom CSS (if there was a conflict I would find it right there where are all applied attributes listed).

Update: I have finally identified the bug - this doesn't happen when I disable ngAnimate module, therefore it's probably related with waiting for animation even when there isn't any to occur, because in my case I have set classNameFilter option for that module so only particular elements of the page would be animated, but not the ui-select one. The logic has to be definitely changed there. Anyways, here's a demonstration: http://plnkr.co/edit/GUZTvSCrkMOPUxrEbXpE?p=preview

softzer0 avatar Jul 17 '16 23:07 softzer0

As told in #1652, a small workarround (while they don't fix this) that worked for me would be

.ui-select-dropdown.select2-drop-active { opacity: 1 !important; }

+1

gustavogsimas avatar Jul 19 '16 13:07 gustavogsimas

Same happened with width. ui-select-search input element got some random width value. It's happening after including ngAnimate.

sergiy-talashko avatar Jul 20 '16 19:07 sergiy-talashko

+1

Chosko avatar Aug 11 '16 10:08 Chosko

+1

dziewonski avatar Oct 27 '16 08:10 dziewonski

+1 "Improved" @twizzzlers solution: http://plnkr.co/edit/qSJUCAQ2Cf6ul7Ji8Oif?p=preview but you still need to click twice to search.

I removed select2-drop-active class because it doesn't get one.

ui-select example w/o ngAnimate: http://angular-ui.github.io/ui-select/demo-bootstrap.html

KrzysztofKarol avatar Nov 17 '16 11:11 KrzysztofKarol

One piece of information about this bug: behaves well until I added 'append-to-body'. If I set it true, I got this bug.. opacitiy remains zero on click whereas 'select2-display-none' class successfully gets removed. Couldn't reproduce on Plunker as well. So for now, thanks to @twizzzlers solution.

bob-lee avatar Mar 22 '17 21:03 bob-lee

On select.js 0.19.5, the problem was on scope.calculateDropdownPos() function, it is failing to call calculateDropdownPosAfterAnimation() where opacity is being set to 1. In my case, the problem occurs only when I set append-to-body="true" so below change worked for me:

var appendToBody = scope.$eval(attrs.appendToBody),
    AppendToBody = appendToBody !== undefined ? appendToBody : uiSelectConfig.appendToBody;

//if (!uisOffset(dropdown).height && $select.$animate && $select.$animate.on && $select.$animate.enabled(dropdown)) {
if (!AppendToBody && !uisOffset(dropdown).height && $select.$animate && $select.$animate.on && $select.$animate.enabled(dropdown)) {

Does it make sense?

bob-lee avatar Mar 24 '17 01:03 bob-lee

+1

HarpoMarx69 avatar Jun 02 '17 07:06 HarpoMarx69

+1. Same issue here when using ngAnimate and 'multiple' select. Without ngAnimate it works fine.

davebednarski avatar Jun 02 '17 15:06 davebednarski

+1 Experiencing the same issue using bootstrap theme, single select and search enabled.

david-meza avatar Jun 23 '17 15:06 david-meza

+1. Same as @davebednarski

DavidRogersDev avatar Sep 13 '17 06:09 DavidRogersDev

Guys set opacity in ui-select-choices class as a workaround:

.ui-select-choices { 
    opacity: 1 !important;
 }

davidbranco avatar Dec 04 '17 18:12 davidbranco

+1 The visibility is working with the workaround. However, the field is not getting the focus so the user needs to click again to start typing

ShurikAg avatar Nov 09 '18 00:11 ShurikAg

find in select.js , this function does not working,but i do not know why,who can help me.

$select.$animate.on('enter', dropdown, function (elem, phase) {
                if (phase === 'close' && needsCalculated) {
                  calculateDropdownPosAfterAnimation();
                  needsCalculated = false;
                }
              });

gdYu avatar Jun 05 '19 12:06 gdYu

fixed it by this way

https://stackoverflow.com/questions/29893423/angular-ui-select-is-not-displaying-the-list-of-options-when-included-in-angular

gdYu avatar Jun 05 '19 12:06 gdYu