GoogleChromeLabs / browser-fs-access

File System Access API with legacy fallback in the browser
https://googlechromelabs.github.io/browser-fs-access/demo/
Apache License 2.0
1.37k stars 82 forks source link

Use showPicker() instead of click() "legacy" #126

Closed jesben closed 1 year ago

jesben commented 1 year ago

My iOS users report sometimes that file browse do not show. Super strange, I don't think there's anything wrong with the code, it's probably more an iOS bug. But maybe you can count more on showPicker() instead of click(), I don't know... In iOS 16 it is supported.

if ('showPicker' in HTMLInputElement.prototype) {
  input.showPicker();
} else {
  input.click();
}

Ref: https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/showPicker

tomayac commented 1 year ago

Thanks for the proposal. Let's hope this increases the reliability on iOS.

jesben commented 1 year ago

It's me who thanks :)

tomayac commented 1 year ago

Now published as v0.31.1.

jesben commented 1 year ago

Perfect I will deploy it this weekend. Will return with status after some time. Thanks.