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

selected event not triggered on mouse click

Open asimhashmi opened this issue 7 years ago • 10 comments

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

asimhashmi avatar Aug 19 '17 16:08 asimhashmi

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

oferh avatar Aug 20 '17 05:08 oferh

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

asimhashmi avatar Aug 20 '17 13:08 asimhashmi

@asimhashmi Were you able to fix this?

malchijah avatar Sep 26 '17 18:09 malchijah

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

asimhashmi avatar Sep 27 '17 04:09 asimhashmi

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.

rishabh010189 avatar May 18 '18 05:05 rishabh010189

I'm still having the same issue

pattersongp avatar Jun 07 '18 15:06 pattersongp

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.

rishabh010189 avatar Jun 13 '18 06:06 rishabh010189

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?

romanpon avatar Aug 26 '18 16:08 romanpon

It's 2020 and I still have this issue.

MrNocTV avatar Feb 05 '20 07:02 MrNocTV

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

MrNocTV avatar Feb 05 '20 08:02 MrNocTV