I’m trying to implement a feature where users can drag playlists from Spotify and drop them into my application to get the playlist URI. The dragging part works fine, but the drop event doesn’t seem to trigger properly.
Here’s my current implementation:
function handleDragOver(event) {
event.preventDefault();
console.log("dragging over target");
}
function handleDropEvent(event) {
event.preventDefault();
console.log("item dropped");
}
var targetArea = document.querySelector(".drop-zone");
targetArea.addEventListener("dragover", handleDragOver, false);
targetArea.addEventListener("drop", handleDropEvent, false);
In my manifest file, I have this configuration:
"AcceptedLinkTypes": [
"playlist"
]
Can someone help me figure out what I’m missing? Is there a specific way to handle Spotify playlist drops to extract the URI correctly?