valor-software / ng2-select

Angular based replacement for select boxes
http://valor-software.github.io/ng2-select/
MIT License
676 stars 588 forks source link

I am using Angular 6, ng2-select is not showing any data #954

Open ChandraTerli opened 6 years ago

ChandraTerli commented 6 years ago

I started with a new project and using angular 6, tried to use ng2-select but after binding the data it does not show in the dropdown. when I look at element in dev tools I see the data bind but it dows not pull on the ui. here is my simple code.. <ng-select [multiple]="true" [allowClear] [items]="items"
placeholder="No item selected"> items: Array = [ { "id": 1, "text": "Table" }, { "id": 2, "text": "Chair" }, { "id": 3, "text": "Light" }

];
BenjaminRichardson commented 6 years ago

Can you create a plunkr, stackblitz, etc. which shows the problem?

joelebeau1 commented 6 years ago

I'm also experiencing this issue right now, using the element as follow:

<ng-select [items]="items" [disabled]="isSubmitting" [active]="active" (data)="refreshValue($event)" (selected)="selected($event)" (removed)="removed($event)" (typed)="typed($event)" placeholder="Search..."></ng-select>

The select element has a charcoal-grey background and white text when not active, which may be an unrelated issue, but typing in the search input doesn't display any items even though I can inspect the component using Augury (Chrome extension for Angular dev) and see that the items are being returned correctly by my service.

Oddly enough, if I hit enter while focused on the ng2-select element it does set the first item as selected and displays that item's text, I just can't see the search results to choose from.

ChandraTerli commented 6 years ago

I am not sure how to create it on plunkr as requested by BenjaminRichards

jcompagner commented 6 years ago

i think the problem is that you are using bootstrap 4.x this works fine: https://stackblitz.com/edit/angular-ghvjfm

but if you would change that it used 4x instead of 3.x then it doesn't work anymore

That is also a problem for us because we build fully now in bootstrap 4.

ChandraTerli commented 6 years ago

You were saying that it does not work on bootstrap 4.x, correct?

jcompagner commented 6 years ago

yes then it doesn't work if i switch between 3 and 4 then 3 works, and 4 gives me that dark gray thing and no popup its just a big styling problem

beshad commented 5 years ago

same issue here, i m using bootstrap 4 and this only shows a black box.

RolfVeinoeSorensen commented 5 years ago

Most likely related to this `.open {

.dropdown-menu { display: block; }

a { outline: 0; } }`

goodiet commented 5 years ago

I was able to get the dropdown showing with the following overriding CSS: .open.dropdown .dropdown-menu { display: block; transform: none; }

GazousGit commented 5 years ago

Hello, I'm using the bootstrap 4 as well, I manage to set up select multiple with dynamic items however the match-item don't use the correct style and button: image

Any idea how I could override the button style for match-item ? :-)

gitaagit02 commented 5 years ago

Most likely related to this `.open {

.dropdown-menu { display: block; }

a { outline: 0; } }`

I still can't show the list. Anyone knows the answer? :( help meeee

vimmisinghani commented 5 years ago

any solution for this issue??

vimmisinghani commented 5 years ago

I set display = 'block' when textbox is typed public typed(value:any) : void { let el:HTMLElement = document.getElementsByClassName("ui-select-choices dropdown-menu")[0] as HTMLElement; if (typeof el !== 'undefined') { el.style.display = 'block'; } }