Open GabrielCousin opened 3 years ago
Hey there!
We've been using this addon quite intensively lately, thanks for the hard work! In order to be able to check the validity of the drag event, we ended up doing this:
import DraggableObjectTarget from 'ember-drag-drop/components/draggable-object-target'; export default class CustomDraggableObjectTarget extends DraggableObjectTarget { validateDragEvent(event) { return event.dataTransfer.types.length === 1 && event.dataTransfer.types.includes('text/plain'); } }
But the problem introduced is that we can no longer use the drag test-helper. This PR aims at adding a types property in the mocked DataTransfer :)
drag
types
Let me know if you see anything I may rework!
Thanks!
Hi @mharris717! Any chance you can have a look at this or discuss anything that may look wrong to you? Thanks a lot 🙌
Hey there!
We've been using this addon quite intensively lately, thanks for the hard work! In order to be able to check the validity of the drag event, we ended up doing this:
But the problem introduced is that we can no longer use the
drag
test-helper. This PR aims at adding atypes
property in the mocked DataTransfer :)Let me know if you see anything I may rework!
Thanks!