oferh / ng2-completer

Angular 2 autocomplete component
http://oferh.github.io/ng2-completer/
MIT License
348 stars 172 forks source link

selected event not triggered on mouse click #302

Open asimhashmi opened 7 years ago

asimhashmi commented 7 years ago

hey, guys, ng2-completer is not emitting the selected event on mouse click, it only emits when I use the arrow keys on the suggestion list and press enter.

<ng2-completer class="col-10"  (selected)="getNewChat($event)" [datasource]="completerData"></ng2-completer>

and

getNewChat(selected: CompleterItem) {
    console.log('item selected');
  }

The above method is only triggered by pressing Enter key Here is the result of ng -v

@angular/cli: 1.2.4
node: 8.1.2
os: win32 x64
@angular/animations: 4.3.1
@angular/common: 4.3.1
@angular/compiler: 4.3.1
@angular/core: 4.3.1
@angular/forms: 4.3.1
@angular/http: 4.3.1
@angular/platform-browser: 4.3.1
@angular/platform-browser-dynamic: 4.3.1
@angular/router: 4.3.1
@angular/upgrade: 4.3.1
@angular/cli: 1.2.4
@angular/compiler-cli: 4.3.1
@angular/language-service: 4.3.1
oferh commented 7 years ago

can you provide a plunker? it's working well in the demo and here

asimhashmi commented 7 years ago

I tried to reproduce it in plunker, but in the plunker, it's working fine but in my project, it sometime get selected item on single click and sometime it doesn't work. any idea what's messing with it, I'm also using angular-bootstrap-md, font-awesome and some other modules

malchijah commented 7 years ago

@asimhashmi Were you able to fix this?

asimhashmi commented 7 years ago

nope, but as a workaround, if you double click on the item to select, it always works

rishabh010189 commented 6 years ago

Did anyone found a fix for the same? I am also experiencing the same issue, it is working fine in many places but fails to work as expected in a few cases, although the code and usage are exactly the same.

pattersongp commented 6 years ago

I'm still having the same issue

rishabh010189 commented 6 years ago

seems to be an unusual bug. The completer is working fine on some places in the same app/ component, but not working on others, despite the same approach and code.

romanpon commented 6 years ago

I have the same issue and found out that selected event is not working when I am clicking on precision touchpad with windows gesture where you can just tap on touchpad and it will send left click but it is working when I am using touchpad button or when I am using mouse

Could anyone verify the same?

MrNocTV commented 4 years ago

It's 2020 and I still have this issue.

MrNocTV commented 4 years ago

I've just got the answer on Stackoverflow: https://stackoverflow.com/questions/60071145/ng2-completer-selected-event-not-triggered-on-mouse-click/60071654#60071654