Skip to main content
Answered

How to get drag and drop event to get coordinates


Forum|alt.badge.img+2

I’m making an app where dropping a card on top of a shape object needs some functions to be called, so I want to catch when cards are moved, I tried using “WIDGETS_TRANSFORMATION_UPDATED”  but it doesn’t give coordinates, I’ve tried getting the common ‘dragend’ on document and it did no go well either, any suggestions would be greatly appreciated.

Best answer by Falk Kühnel

After the event

event.data

you have to get the drop information for each item afterwards by id:

await miro.board.widgets.get({id: "3074457347524474470"})

 

View original
Was it helpful?
100% found this helpful

3 replies

Falk Kühnel
Forum|alt.badge.img+2
  • Active Contributor
  • 33 replies
  • Answer
  • April 28, 2020

After the event

event.data

you have to get the drop information for each item afterwards by id:

await miro.board.widgets.get({id: "3074457347524474470"})

 


Forum|alt.badge.img+2
  • Author
  • Beginner
  • 6 replies
  • April 29, 2020

….That makes so much sense, I’m kinda embarrassed I didn’t think of that, thank you!


Forum|alt.badge.img+1

Saifis

 

I need to do something similar but I am a complete noob when it comes to miro development, would you mind sharing some of the code you used to do this Id love to take a look!


Reply