Skip to content

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

@IMFJS

Description

@IMFJS

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

AB#54251830

Metadata

Metadata

Labels

bugSomething isn't workingtrackedWe are tracking this work internally.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions