tauri icon indicating copy to clipboard operation
tauri copied to clipboard

How can I monitor the operation completed by startDragging and dragging over?

Open dydhyhwu opened this issue 3 years ago • 6 comments

How can I monitor the operation completed by startDragging and dragging over? I want to do something after dragging is over

dydhyhwu avatar Aug 02 '22 04:08 dydhyhwu

We don't have that yet :(

lucasfernog avatar Aug 02 '22 16:08 lucasfernog

if you mean the window dragging, then you should listen to the move event

amrbashir avatar Aug 02 '22 17:08 amrbashir

if you mean the window dragging, then you should listen to the move event

I want to do something when the window drag ends, something like HTML's mouseup event

dydhyhwu avatar Aug 03 '22 00:08 dydhyhwu

You could debounce the move event listener to know when the user stops moving it.

lucasfernog avatar Aug 03 '22 02:08 lucasfernog

You could debounce the move event listener to know when the user stops moving it.

It's a great idea!!! I'll try, thanks.

dydhyhwu avatar Aug 03 '22 02:08 dydhyhwu

Found a scene, what should I do if I keep dragging but not moving? My solution is to add the detection of whether the left mouse button is pressed to determine whether it is in a dragging state, but I don't know if there is such an API

dydhyhwu avatar Aug 03 '22 03:08 dydhyhwu

The OS doesn't give us enough information to know when the window dragging ends. As we suggested earlier, you should listen to the move event and debounce it.

amrbashir avatar Aug 31 '22 22:08 amrbashir