ShowOpenDialogAsync causing duplicate windows #840

Closed
opened 2026-01-29 16:49:53 +00:00 by claunia · 3 comments
Owner

Originally created by @DatReki on GitHub (Jan 2, 2023).

Originally assigned to: @GregorBiswanger on GitHub.

When making an application I ran into the issue where every time I revisited the page with a ShowOpenDialogAsync function tied to a button it would open an additional instance of the dialog.

Using .Net 5, ElectronNET.API v13.5.1 & Node.JS v16.18.1.
I've reduced the issue to the basics and made a separate repository.

Originally created by @DatReki on GitHub (Jan 2, 2023). Originally assigned to: @GregorBiswanger on GitHub. When making an application I ran into the issue where every time I revisited the page with a `ShowOpenDialogAsync` function tied to a button it would open an additional instance of the dialog. Using .Net 5, ElectronNET.API v13.5.1 & Node.JS v16.18.1. I've reduced the issue to the basics and made a separate [repository](https://github.com/DatRekiBurner/electron.net-ShowOpenDialogAsync-issue).
claunia added the bug label 2026-01-29 16:49:53 +00:00
Author
Owner

@cosmo0 commented on GitHub (Jan 18, 2023):

Are you sure you're not binding the click event multiple times? What happens when you replace

document.getElementById("select-directory").addEventListener("click", () => {
  ipcRenderer.send("select-directory");
});

with

document.getElementById("select-directory").addEventListener("click", () => {
  alert('clicked');
});

?

@cosmo0 commented on GitHub (Jan 18, 2023): Are you sure you're not binding the click event multiple times? What happens when you replace ``` document.getElementById("select-directory").addEventListener("click", () => { ipcRenderer.send("select-directory"); }); ``` with ``` document.getElementById("select-directory").addEventListener("click", () => { alert('clicked'); }); ``` ?
Author
Owner

@DatReki commented on GitHub (Jan 21, 2023):

It just sends the alert once but still opens one additional window every time the page is re-visited.

electron-dir-select

@DatReki commented on GitHub (Jan 21, 2023): It just sends the alert once but still opens one additional window every time the page is re-visited.<br> ![electron-dir-select](https://user-images.githubusercontent.com/31971873/213882216-01c01c3c-8272-428b-ba2a-aa6605ed5181.gif)
Author
Owner

@GregorBiswanger commented on GitHub (Mar 28, 2023):

🎉🚀 New Electron.NET version 23.6.1 released 🚀🎉

With native Electron 23 and .NET 6 support. Your problem should be fixed here. If you continue to have the problem, please let us know. Please note the correct updating of your API & CLI. Info in the README. Have fun!

@GregorBiswanger commented on GitHub (Mar 28, 2023): 🎉🚀 New Electron.NET version 23.6.1 released 🚀🎉 With native Electron 23 and .NET 6 support. Your problem should be fixed here. If you continue to have the problem, please let us know. Please note the correct updating of your API & CLI. Info in the README. Have fun!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/Electron.NET#840