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

Closed
opened 2020-06-04 21:45:53 +00:00 by ianjennings · 1 comment
ianjennings commented 2020-06-04 21:45:53 +00:00 (Migrated from github.com)

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.

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](https://user-images.githubusercontent.com/318295/83813413-e8357c00-a682-11ea-88db-d52761aea555.png) Tested with the example xlsx files [here](https://file-examples.com/index.php/sample-documents-download/sample-xls-download/).
SheetJSDev commented 2020-06-07 07:37:32 +00:00 (Migrated from github.com)

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.

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`](https://www.electronjs.org/docs/api/dialog#dialogshowopendialogsyncbrowserwindow-options), adding a proper guard for the case that the dialog is canceled.
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: sheetjs/sheetjs#1981
No description provided.