mirror of
https://github.com/ElectronNET/Electron.NET.git
synced 2026-02-03 21:25:13 +00:00
Setting Modal = true in BrowserOptions does not work #765
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @lukebordonaro on GitHub (Feb 21, 2022).
Version: 13.5.1
Target: windows
If you set
BrowserWindowOptions.Modal = truewhen creating a newBrowserWindow, the created window will not be a modal window even after setting the parent.Consider this code:
The observed behavior of the child window is that it is NOT a modal window, and you can still interact with the main window (
parent). The value ofisModalin theOnShowhandler isfalse, too.I haven't investigated this, but it's possible that for modal windows to work the
parentmust be set inside theBrowserWindowOptions: https://www.electronjs.org/docs/latest/api/browser-window/#modal-windows