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

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

Open ChandraTerli opened this issue 6 years ago • 13 comments

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" }

];

ChandraTerli avatar May 16 '18 15:05 ChandraTerli

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

BenjaminRichardson avatar May 17 '18 19:05 BenjaminRichardson

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.

joelebeau1 avatar May 23 '18 14:05 joelebeau1

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

ChandraTerli avatar May 23 '18 14:05 ChandraTerli

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.

jcompagner avatar May 29 '18 11:05 jcompagner

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

ChandraTerli avatar May 29 '18 13:05 ChandraTerli

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

jcompagner avatar May 29 '18 14:05 jcompagner

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

beshad avatar Jul 17 '18 03:07 beshad

Most likely related to this `.open {

.dropdown-menu { display: block; }

a { outline: 0; } }`

RolfVeinoeSorensen avatar Jul 19 '18 07:07 RolfVeinoeSorensen

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

goodiet avatar Sep 13 '18 22:09 goodiet

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 ? :-)

GazousGit avatar Dec 13 '18 10:12 GazousGit

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

gitaagit02 avatar May 02 '19 04:05 gitaagit02

any solution for this issue??

vimmisinghani avatar Jun 14 '19 12:06 vimmisinghani

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'; } }

vimmisinghani avatar Jun 14 '19 12:06 vimmisinghani