Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Electron Demo "Click here to select a file" does not load file properly. #1981

Closed
ianjennings opened this issue Jun 4, 2020 · 1 comment
Closed
Assignees

Comments

@ianjennings
Copy link
Contributor

ianjennings commented Jun 4, 2020

When clicking on the button highlighted in red, the file prompt shows but the UI does not respond to the selected file.

The functionality highlighted in green works properly.

image

Tested with the example xlsx files here.

@ianjennings ianjennings changed the title Electron Demo "Click here Electron Demo "Click here to select a file" does not load file properly. Jun 4, 2020
@SheetJSDev
Copy link
Contributor

This is related to an API change somewhere between 1.7.5 and 9.

https://github.com/SheetJS/sheetjs/blob/master/demos/electron/index.js#L68 the code uses electron.dialog.showOpenDialog and grabs the result.

The current version returns a promise https://www.electronjs.org/docs/api/dialog#dialogshowopendialogbrowserwindow-options

However 1.7.5 returned an array of strings https://github.com/electron/electron/blob/v1.7.5/docs/api/dialog.md

The easiest thing might be to change the call to showOpenDialogSync, adding a proper guard for the case that the dialog is canceled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@ianjennings @SheetJSDev and others