[BUG] Input element not getting set in Chrome
See original GitHub issueDescribe 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:
- Go to the basic example
- Select any file
- Disable the
display: none
styling on the input element - 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: Chrome:
Desktop (please complete the following information):
- OS: macOS
- Browser: Chrome
- Version: 102.0.5005.61 (Official Build) (x86_64)
Issue Analytics
- State:
- Created a year ago
- Reactions:2
- Comments:5
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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
tofalse
.boom~~~ @bvangraafeiland This helped me a lot. I also spend a whole day to debug this.