Skip to content

Commit

Permalink
electron: Open dialogs are not modal (eclipse-theia#10768)
Browse files Browse the repository at this point in the history
Pass the electron BrowserWindow to the dialog.showOpenDialog command, to
make the dialog modal.


Signed-off-by: Alexandra Buzila <abuzila@eclipsesource.com>
  • Loading branch information
AlexandraBuzila committed Feb 17, 2022
1 parent f7dda08 commit 604bbce
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ export class ElectronFileDialogService extends DefaultFileDialogService {
override async showOpenDialog(props: OpenFileDialogProps, folder?: FileStat): Promise<MaybeArray<URI> | undefined> {
const rootNode = await this.getRootNode(folder);
if (rootNode) {
const { filePaths } = await electronRemote.dialog.showOpenDialog(this.toOpenDialogOptions(rootNode.uri, props));
const electronWindow = electronRemote.getCurrentWindow();
const { filePaths } = await electronRemote.dialog.showOpenDialog(electronWindow, this.toOpenDialogOptions(rootNode.uri, props));
if (filePaths.length === 0) {
return undefined;
}
Expand Down

0 comments on commit 604bbce

Please sign in to comment.