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

[Bug]: <input type="file"> is not showing dialog on click #42013

Closed
3 tasks done
staniel359 opened this issue May 1, 2024 · 9 comments
Closed
3 tasks done

[Bug]: <input type="file"> is not showing dialog on click #42013

staniel359 opened this issue May 1, 2024 · 9 comments

Comments

@staniel359
Copy link

Preflight Checklist

Electron Version

30.0.1

What operating system are you using?

Ubuntu

Operating System Version

22.04

What arch are you using?

x64

Last Known Working Electron version

29.3.0

Expected Behavior

Files dialog should open:
image

Actual Behavior

Doesn't:
Screencast from 01-05-24 12:24:10.webm

Testcase Gist URL

No response

Additional Information

I'm calling it from WebContentsView.

@tufik2
Copy link

tufik2 commented May 1, 2024

I believe you will need to use Electron Native API to read / write to show dialogs... This is executed in the main render, so you will need to use IPC to communicate between your render (HTML) and your main render (nodeJS)
https://www.electronjs.org/docs/latest/api/dialog

const { dialog } = require('electron')
console.log(dialog.showOpenDialog({ properties: ['openFile', 'multiSelections'] }))

@staniel359
Copy link
Author

@tufik2 But it was working from renderer before.
Could this be an issue with WebContentsView?

@Kilian
Copy link
Member

Kilian commented May 2, 2024

Hi @staniel359, I created this test fiddle: https://gist.github.com/Kilian/f1566f60bd54ab1ca5dd8ed6887aa1d1 and it works fine for me on Ubuntu 23.04 on both electron 30.0.1 and 30.0.2. Does this example work for you? If it does, can you made a reduced fiddle showing the issue?

@staniel359
Copy link
Author

staniel359 commented May 2, 2024

@Kilian

image

@izaakschroeder
Copy link

I believe I have experienced this issue also.

@Kilian
Copy link
Member

Kilian commented May 3, 2024

@staniel359 You'll get your issue resolved faster if you supplied a testcase.

@safris
Copy link

safris commented May 3, 2024

@Kilian, please see #42018 for a test case 🙏

@82318179
Copy link

82318179 commented May 6, 2024

For example, this website: https://convertio.co/zh/ico-converter/ Its function is to upload. If you load this website in browserview and click the upload button on the website page, a file selection box will pop up. However, once you use WebContentsView to load the website and click the upload button on the page, there is no response. When can this bug be fixed? my os is win11

@codebytere
Copy link
Member

Looks like i fixed this incidentally to another bug: #41966. The PR has been backported to 30 already and will be out in the next patch release!

@codebytere codebytere self-assigned this May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 🛠️ Fixed for Next Release
Development

No branches or pull requests

8 participants