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.

[BUG] Input element not getting set in Chrome

See original GitHub issue

Describe the bug The file input element is not getting populated with the selected files in Chrome when using the OS file dialog. This is working properly in Firefox and Safari. When dragging files to the dropzone, it works in none of the browsers, but this is to be expected. #1037 may be related, although no solution was found there.

To Reproduce Steps to reproduce the behavior:

  1. Go to the basic example
  2. Select any file
  3. Disable the display: none styling on the input element
  4. Firefox/Safari will display the input with the selected file, but in Chrome it’ll say “No file chosen”

Expected behavior Behavior should be consistent across browsers.

Screenshots Firefox: Screenshot 2022-06-09 at 07 47 46 Chrome: Screenshot 2022-06-09 at 07 48 07

Desktop (please complete the following information):

  • OS: macOS
  • Browser: Chrome
  • Version: 102.0.5005.61 (Official Build) (x86_64)

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:2
  • Comments:5

github_iconTop GitHub Comments

8reactions
bvangraafeilandcommented, Jun 9, 2022

After doing some research myself, I found out that this is due to the default use of the File System Access API. The showOpenFilePicker method is not implemented in Safari and Firefox (https://developer.mozilla.org/en-US/docs/Web/API/Window/showOpenFilePicker#browser_compatibility), therefore this piece of codes disables the API.

In Chrome, the API is available, so the input element is skipped. Is this intended behavior though?

For now, I’ve fixed it by manually setting useFsAccessApi to false.

0reactions
wpickachucommented, Jul 7, 2022

boom~~~ @bvangraafeiland This helped me a lot. I also spend a whole day to debug this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to access text input element in chrome extension
I'm trying to obtain a "real-time" text data feed from the input field. However, when I try to run the extension, I get...
Read more >
The behavior of <a> including <form> and <input> tag when ...
1. go to http://jsfiddle.net/MyShin/LsLtzrhy/ · 2. move the focus each input and press the enter key · 3. check the alert message
Read more >
<input type="search"> - HTML: HyperText Markup Language
An input field can have spell checking enabled if it doesn't have the readonly attribute set and is not disabled. The value returned...
Read more >
Error Messages | Maps JavaScript API - Google Developers
The script element that loads the Maps JavaScript API is not being included correctly on your page. In order for the API to...
Read more >
Why the number input is the worst input - Stack Overflow Blog
It should be noted I am not alone in the anti-number input camp. The UK Government posted ... Or you could get it...
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