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

225
Views
Drag & Drop Puzzle with drag & drop api, vue and canvas

Im in desperate need for help.

Im trying to create something like https://goodies.pixabay.com/jquery/snap-puzzle/demo.html, just using Vue, Canvas, Drag & Drop API, and regular mouseMove events. However, it seems like whenever im using the mouseMove event for dragging items around the screen, it disables the Drag & Drop api.

For example, Im dragging a tile into one of the slots, nothing happens :( - If I remove the line from the template in Tile.vue

 @mousedown.prevent="updateTilePosition"

It works, however, then I wont have the ability to drag/drop items around the screen. It seems the drag & drop API limits in to the "available slots", and if I try moving one of the tiles in just snaps back to the original position, UNLESS i drag it into one of the available slots then it snaps the tile into the container as expected

The whole code is available here: https://codesandbox.io/s/vue-puzzle-vip9f

Note: Each tile represents a "clip" from the image, using Canvas (However, on Codesandbox it doesn't seem to draw the image, so for the sake of it, just imaging each tile represent something from the main image)

As mentioned, it should work much like the https://goodies.pixabay.com/jquery/snap-puzzle/demo.html - But it seems like the approach im using, it's nearly impossible :( - ANY help would be greatly appreciated

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!