wry
wry copied to clipboard
`file_drop_handler` prevent default behaviour on Windows
So it turns out file_drop_handler will block default behaviour on Windows no matter what.
But there are some new webview2 API we could use to invoke such behaviour again.
We can edit dragndrop example to return true to test it.
Default behavior is blocked on Linux as well.
Hmm looks like wry's doc stick to the truth. We just need to update the doc in tauri configuration.
@wusyong here is the branch I have setup for windows https://github.com/tauri-apps/wry/tree/drag-drop-webview2. I still can't get files to drop on <input> elements and after passing DragEnter to WebviewController::DragEnter, other DropTarget methods are never called.
I am not sure why this happens to be honest, maybe because we override all children of the window or something and that's why I wanted to wait for https://github.com/MicrosoftEdge/WebView2Feedback/issues/2907 but I honestly have no idea.
Calling https://docs.rs/webview2-com/latest/webview2_com/Microsoft/Web/WebView2/Win32/trait.ICoreWebView2Controller4_Impl.html#tymethod.SetAllowExternalDrop didn't help either
Upstream issue: https://github.com/MicrosoftEdge/WebView2Feedback/issues/2658 Looks like its not possible to get the event, and implement drop target ourselves will replace the original one for webview2.
Any news on this? Does WebView2 expose the right APIs as of today and it's just about using them right, or are we just completely stuck still? Can we help in any way?