Wednesday, June 5, 2024
 Popular · Latest · Hot · Upcoming
50
rated 0 times [  51] [ 1]  / answers: 1 / hits: 8392  / 5 Years ago, thu, november 28, 2019, 12:00:00

I'm working on custom drag and drop module to Vue and I found a problem. To override browser D&D (because I need) on pointer down I'm cloning div which I want to drag and then trigger pointermove (on this event, I'm setting X and Y on cloned div), when I fire pointer up, the value of this div is transferred to drag place. To target element under cloned(dragged) div on pointer up event, I used a css property pointer-events: none (on cloned div) and everything is fine on the desktop. On mobile, event targeting always dragged element.



There is console.log from triggered events:
logged events


More From » css

 Answers
4

I found answer to my question in another question:
How to find out the actual event.target of touchmove javascript event?


We can target element under our event by


document.elementFromPoint(
e.clientX,
e.clientY
);

[#5491] Sunday, November 24, 2019, 5 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
adrienkeithr

Total Points: 503
Total Questions: 126
Total Answers: 110

Location: Lithuania
Member since Fri, Sep 4, 2020
4 Years ago
;