I'm trying to implement a drag and drop window for users to upload images in the app.I see that it was implemented in 1.4 and there is a working example for showing a list of dragged fileshttps://github.com/JetBrains/compose-multiplatform/issues/3294I'm simply trying to alter this example to work with images. The interface says theres 3 types, FilesList, Images, Text but no matter what I drag into the box it's returning as FileListandroidx.compose.ui.DragDataFilesListImpl@5e186db7So changing the check from
if (dragData is DragData.FilesList)
to
if (dragData is DragData.Image)
is always false even if I drag an image in?I don't see any way to alter this behaviour either? Anyone know why this sample is considering every input as a FileList and how do I get it to return Image if I actually drag an image in.
Ben Abramovitch
05/02/2024, 8:12 PM
And I know I can read the image (if I decide its an image) from the file path I get back, but I'd really just like this to work as its seemingly described as possible without having to implement that.
Ben Abramovitch
05/03/2024, 2:17 AM
The more I think and look at this, the more it seems like this is actually the intended behaviour if it's dragged from outside the app into the app. In the meantime I do have it working by taking the path and working with it myself.