Skip to content

How to set Electron file dialog to modal? #13037

Answered by AlexandraBuzila
zole40 asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @zole40

There's currently no way to set the modal option via a preference. The expectation is that the callers of the FileDialogService pass the modal prop in the arguments, for example:

this.fileDialogService.showOpenDialog({ title: 'My Open Dialog', canSelectFiles: false, modal: true }, folder)

If you want all open and save dialogs created by the service to always be modal, then your workaround is the way to go.

Hope this helps!

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@AlexandraBuzila
Comment options

@zole40
Comment options

Answer selected by zole40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants