Skip to content

[Problem/Bug]: External File Drags are blocked while a modal dialog is open #5198

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
JephDiel opened this issue Apr 10, 2025 · 2 comments
Open
Labels
bug Something isn't working

Comments

@JephDiel
Copy link

JephDiel commented Apr 10, 2025

What happened?

If a modal dialog is open, in my case a file selector, I don't get any drag events in the web layer when dragging a file into the window, either from the modal file selector itself, or my desktop/an explorer.exe window.

This is allowed in Electron, so this feature reduction could interfere with some users workflows.

Importance

Moderate. My app's user experience is affected, but still usable.

Runtime Channel

Stable release (WebView2 Runtime)

Runtime Version

135.0.3179.54

SDK Version

3116.0

Framework

Winforms

Operating System

Windows 11

OS Version

26100.3476

Repro steps

Using the WebView2WindowsFormsBrowser example, add:

window.addEventListener("dragenter", e => { alert("Drag Detected!") }); document.getElementById("openFile").addEventListener("click", e => { window.showOpenFilePicker(); })
to AppStartPage.js, and add:
<button id="openFile">Open File Selector</button>
to AppStartPage.html.

Then run the solution, click the "Open File Selector" button, and attempt to drag a file into the window and you won't see an alert.

Repros in Edge Browser

No, issue does not reproduce in the corresponding Edge version

Regression

Don't know

Last working version (if regression)

No response

@JephDiel JephDiel added the bug Something isn't working label Apr 10, 2025
@sivMSFT
Copy link

sivMSFT commented Apr 11, 2025

Hi @JephDiel, could you please clarify whether this is an issue you're encountering or a feature request you're making?

@JephDiel
Copy link
Author

I think "issue" is more apt. Events which are fired in Edge and Electron are not firing in WebView2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants