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

96
Views
pointerup event is missing

I am trying to detect pointerdown/pointermove/pointerupmouse event. I wrote the code below for event detection.

document.addEventListener("pointerdown", mouse_click, false);
document.addEventListener("pointerup", mouse_release, false);
document.addEventListener("pointermove", mouse_move, false);

generally works fine, but "pointerup" is missing if the pointer is over the image when the mouse is released. However, I discovered that if I do createElement('canvas') before releasing the mouse, it works.

    canvas = document.createElement('canvas');
    canvas.width=window.document.body.scrollWidth
    canvas.height=window.document.body.scrollHeight
    document.body.appendChild(canvas);

I don't know why this works. Could you please explain why?

Thank you for reading.

about 4 years ago · Juan Pablo Isaza
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!