#Bug in Drag N Drop In Linux

4 messages · Page 1 of 1 (latest)

bronze leaf
#

I’ve been testing different ways to use drag-and-drop on Linux with KDE Wayland based on the fix of this issue. I have to say that sometimes it works, and other times it doesn’t. And I think this may be a bug in Tauri.

For example, in the video, you can see that sometimes it detects the paths in the payload, while other times it leaves it empty. There are times when it detects it immediately and works 100%. I wanted to know if this could be an issue with my implementation (I tried several approaches, and the behavior is always the same—sometimes it works, and other times it doesn’t).

The idea is for the user to drag an image, and it displays on the screen. But as I mentioned, sometimes it works, and sometimes it doesn’t, so I'm not sure if it’s an issue with my application or if there might still be a bug. I have to say that this implementation works perfectly fine on Windows

GitHub

Build smaller, faster, and more secure desktop and mobile applications with a web frontend. - Issues · tauri-apps/tauri

subtle halo
#

Can you try again with Tauri 2.1.0 (don't forget to run cargo update to update inner crates too)?

bronze leaf
# subtle halo Can you try again with Tauri 2.1.0 (don't forget to run `cargo update` to update...

Thank you for the quick response. I tested it on Linux, and it works perfectly. Later, I’ll check if it still works well on Windows.

Just a quick question, though: is there a way to get typing for what would be inside payload in the event? Currently, I have to create a TypeScript type myself, but I wanted to know if Tauri already has something integrated.

type DropEventPayload = {
  paths: string[];
  position: {
    x: number;
    y: number;
  };
};

Since the payload is generic:

interface Event<T> {
  /** Event name */
  event: EventName;
  /** Event identifier used to unlisten */
  id: number;
  /** Event payload */
  payload: T;
}
subtle halo
#

There should be a DragDropEvent type already.