question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Opening a dialog fails on Windows 10

See original GitHub issue

Hey great library!. I’ve been using it for a personal project for a few months and as i try to port my app to windows 10 i noticed this.

Offending code is called after parsing the json recieved from window.external.invoke

let file_name = view.dialog(Dialog::SaveFile, "Choose Database File", "");

And in another spot

let file_name = view.dialog(Dialog::OpenFile, "Choose Database File", "");

Both react the same way, i never see the file dialog and it immediately returns an empty string. Any ideas what might cause this?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
bytebuddhacommented, Aug 20, 2018

Of coarse here is a test program showing the bug

extern crate web_view;


use web_view::WebView;
use web_view::MyUnique;
use web_view::Content;
use web_view::Dialog;
use web_view::Alert;
use web_view::run;

const HTML: &str = r#"
<DOCTYPE html>
<html>
  <body>
      <button onclick="window.external.invoke('open')">Open File Dialog</button>
      <button onclick="window.external.invoke('save')">Save File Dialog</button>
      <button onclick="window.external.invoke('directory')">Choose Directory Dialog</button>
      <button onclick="window.external.invoke('alert-info')">Info Alert</button>
      <button onclick="window.external.invoke('alert-warning')">Warning Alert</button>
      <button onclick="window.external.invoke('alert-error')">Error Alert</button>
  </body>
</html>
"#;

fn callback(view: &mut WebView<()>, arg: &str, user_data: &mut ()) {
    match arg {
        "open" => {
            println!("Attempting to open 'OpenFile' dialog");
            view.dialog(Dialog::OpenFile, "Test Open Dialog", "");
        },
        "save" => {
            println!("Attempting to open 'SaveFile' dialog");
            view.dialog(Dialog::SaveFile, "Test Open Dialog", "");
        },
        "directory" => {
            println!("Attempting to open 'ChooseDirectory' dialog");
            view.dialog(Dialog::ChooseDirectory, "Choose Directory Dialog", "");
        },
        "alert-info" => {
            println!("Attempting to open info alert");
            view.dialog(Dialog::Alert(Alert::Info), "Info Alert", "");
        },
        "alert-warning" => {
            println!("Attempting to open warning alert");
            view.dialog(Dialog::Alert(Alert::Warning), "Info Alert", "");
        },
        "alert-error" => {
            println!("Attempting to open error alert");
            view.dialog(Dialog::Alert(Alert::Error), "Info Alert", "");
        }
        _ => {}
    }
}

fn main() {
    let (_, _) = run("open dialog test",
            Content::Html(HTML),
            Some((500, 500)),
            true,
            true,
            |_|{},
            callback,
            ()
        );

}

All of the alerts work so ignore those, but none of the file dialog’s ever open

0reactions
prixtcommented, Sep 3, 2019

~This also happens to me on Window 10, but only on the stable-msvc toolchain. Dialog functions normally when built on the stable-gnu toolchain.~ nvm, still having the same problem.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Settings Dialog Won't Open in Windows 10? 10 Ways to Fix
1. Press Windows + X to open the Power User Menu. Then, type Windows PowerShell.
Read more >
Windows 10 Open File dialog problem - Microsoft Community
First try to access the Bios Setup, activate the UEFI option and disable the Secure Boot and Fast Boot options. To finish, press...
Read more >
Fix: Settings Dialog Won't Open in Windows 10 - Get Droid Tips
How to fix Settings Dialog Won't Open in Windows 10? Re-register the Settings App in Windows 10: Re-install and Re-register All Windows Apps ......
Read more >
Dialog Box Has No Text Error In Windows 10/8/7 [Tutorial]
Dialog Box Has No Text Error In Windows 10 /8/7 [Tutorial]Some users become empty, blank and do not have text dialog boxes on...
Read more >
Windows 10 Open File dialog problem
Windows 10 Open File dialog problem · Open a new Explorer window. · Click View in the ribbon. · Click Options. · Under...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found