@ng-select 3.x doesn't work mouse click options
Asked Answered
D

2

5

After migrating to @ng-select v3.x (https://github.com/ng-select/ng-select), mouse click no longer works on items. My application uses bootstrap 4 and angular 8. Returning to v2.20.5 version works again normally.

Someone with the same problem?

Dukedom answered 6/9, 2019 at 12:17 Comment(1)
Welcome to Stack Overflow! Please review writing the perfect question to help you to ask a good question, and thus get a good answer. Add a minimal code example to your question.Rewarding
J
7

Had the same problem. Changing the datasource to an array instead of a function (that returned the same array) solved the issue.

Jarmon answered 27/11, 2020 at 13:11 Comment(1)
I have been stuck with this for more than an hour. THANKS!!!!Embroider
K
1

ok, I had encountered similar issue, sweating to find out why my ngselect was not reacting on click but was selecting entries on tab. Finally found out why : the items i wanted to use were stored in a Set to get it work I made a method in my component to return this set as an array :

ngSelectItems() {
    return Array.from(this.mySet.values());
  }

with that method everything seemed to work, but no click were triggered on options. Finally made an coponent array property mirroring my Set and use it in the ngselect item property to solve the issue. I thing it's a bug of ngselect.

I created an issue here : https://github.com/ng-select/ng-select/issues/1405

Konstantin answered 30/10, 2019 at 8:47 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.