Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

133
Views
How to trigger dragend event

How do I force a dragend event to fire? I use a library that automatically adds a listener to elements which looks for a long press (for touch screen to simulate a right click event). I don't want that to fire when a user tries to drag (but the nature of dragging means, they click and hold/long press)

I know how to set one up, but what I'd like is

instrumentInfo.addEventListener("dragstart", function (e) {
    e.preventDefault();//stop longpress working for touch screens
    e.dragend(); //not going to work
    instrumentInfo.dispatchEvent("dragend");//does not work
    instrumentInfo.dispatchEvent(new Event("dragend"));//no exception but does not seem to work
}

I understand I may get race conditions and am OK with that

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

And the answer is, execute the mouseup event

instrumentInfo.dispatchEvent(new Event("mouseup"));
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!