angular2-draggable icon indicating copy to clipboard operation
angular2-draggable copied to clipboard

Click events not working

Open khoying opened this issue 5 years ago • 11 comments

This is exactly what I was looking for and it is so close to working. However, it unfortunately seems to break my click handlers in my other components when using ngDraggable. I am using version 2.1.2.

khoying avatar Sep 13 '18 17:09 khoying

@khoying Did you set [preventDefaultEvent]?

xieziyu avatar Sep 14 '18 02:09 xieziyu

I tried setting it to true and to false. It did not help.

khoying avatar Sep 14 '18 11:09 khoying

Please provide more info about your code snippets, that would be helpful to identify where the problem is.

xieziyu avatar Sep 17 '18 02:09 xieziyu

@xieziyu +1 Click handlers are not working in draggable blocks that are added with *ngFor dynamically. In blocks that were from the beginning in html template - there click handlers work fine. Please fix it for dynamic blocks. Thank you!

bejalane avatar Sep 25 '18 00:09 bejalane

Is this fixed?

CoolCodeRush avatar Apr 18 '19 13:04 CoolCodeRush

I'm having the same issue, click handlers don't work when the draggable blocks are added dynamically with ngFor, is there a solution or workaround?

RodrigoMtz10 avatar Jul 17 '19 13:07 RodrigoMtz10

+1 This is really a big problem. Would be great if this would be fixed!

amir-alic avatar Jul 22 '19 15:07 amir-alic

@amir-alic @RodrigoMtz10 Hi, could you help write some codes to reproduce this issue on StackBlitz? I tested the draggable blocks added dynamically with ngFor and their click handlers were working as expected.

xieziyu avatar Jul 24 '19 02:07 xieziyu

@xieziyu

Hello, I found out that dynamically adding divs it's not the problem. I still don't know the root cause of my problem.

I made a test with my StackBlitz: https://stackblitz.com/edit/angular-awyh7l

Problem is: dblclick event is not firing on TEST div. It randomly happens only on my computer.

My workmates tried the dblclick on the stackblitz, and it works well for them, the event is firing.

We are all using Chrome, same version, Windows 10.

I wish I could find out the pattern of the issue but I still can't.

RodrigoMtz10 avatar Aug 01 '19 21:08 RodrigoMtz10

I am also facing the same issue. I have created a stackblitz to repro this issue. Steps to reproduce:

  1. Drag the first element. This is draggable, as click event is firing.
  2. Now try to drag the second element. It won't be draggable, because click event is not firing.

Kindly provide a solution to solve this issue.

stackblitz url: https://stackblitz.com/edit/angular2-draggable

Varshamathukumalli avatar Aug 27 '19 07:08 Varshamathukumalli

+1

coloz avatar Aug 31 '20 07:08 coloz