Question

I'm trying to drag and drop playlists from the side-bar onto my application window. I got it working to accept drops on my app's name in the app list, but that's not what I need right now.

Is there a way to enable my view to accept playlists dragged on it?

models.application.addEventListener("dropped", function() {
  console.log(models.application.dropped)
})

And in my manifest.json I have

"AcceptedViewDropTypes": [
    "playlist"
],

"AcceptedLinkTypes": [
    "playlist"
],

This setup triggers the console log only if I drop on my app's name.

Was it helpful?

Solution

There is an example of drag & drop for a Playlist in the Spotify Apps Tutorial, called Dragging and dropping content into an app.

The way it works is like regular drag & drop, listening to events such as dragstart or drop.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top