Skip to content
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

[Problem/Bug]: IsDefaultDownloadDialogOpenChanged event not occurring when closing the dialog via ESC #4807

Open
Optimierungswerfer opened this issue Sep 12, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@Optimierungswerfer
Copy link

What happened?

The IsDefaultDownloadDialogOpenChanged event is not occurring when the default download dialog gets closed using the Escape key.

This affects our app because we have a toolbar button, which indicates the current state of the download dialog (checked/unchecked), which gets out of sync because of this. It also messes with other parts of our logic and in our case stops the user from accessing the download dialog afterwards altogether.

Importance

Important. My app's user experience is significantly compromised.

Runtime Channel

Stable release (WebView2 Runtime)

Runtime Version

128.0.2739.67

SDK Version

1.0.2739.15

Framework

Win32

Operating System

Windows 11

OS Version

22631.4169

Repro steps

Take the WebView2APISample app and inside AppWindow::RegisterEventHandlers add an event handler for the IsDefaultDownloadDialogOpenChanged event (note that you first need to additionally query the ICoreWebView2_9 interface):

//! [IsDefaultDownloadDialogOpenChanged]
// Register a handler for the IsDefaultDownloadDialogOpenChanged event.
CHECK_FAILURE(m_webView9->add_IsDefaultDownloadDialogOpenChanged(
  Callback<ICoreWebView2IsDefaultDownloadDialogOpenChangedEventHandler>(
    [](ICoreWebView2* sender, IUnknown*) -> HRESULT
    {
      return S_OK;
    })
  .Get(),
  nullptr));
//! [IsDefaultDownloadDialogOpenChanged]

Set a breakpoint inside the event handler.
Start the app and click into the WebView2 content to give it the focus.
Press Ctrl+J to open the default download dialog. You will run into the breakpoint as expected, continue.
Click into the download dialog to give it the focus.
Press Escape to close the dialog. You will not run into the breakpoint this time, when you should have.

If you close the dialog using the close button (X), the event handler runs as expected.

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

@Optimierungswerfer Optimierungswerfer added the bug Something isn't working label Sep 12, 2024
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

1 participant