landscape/useS3: restore behaviour on ios
@@ -75,6 +75,7 @@ const useS3 = (s3: S3State, { accept = '*' } = { accept: '*' }): IuseS3 => {
const fileSelector = document.createElement('input');
fileSelector.setAttribute('type', 'file');
fileSelector.setAttribute('accept', accept);
+ fileSelector.style.visibility = 'hidden';
fileSelector.addEventListener('change', () => {
const files = fileSelector.files;
if (!files || files.length <= 0) {
@@ -82,7 +83,9 @@ const useS3 = (s3: S3State, { accept = '*' } = { accept: '*' }): IuseS3 => {
return;
}
uploadDefault(files[0]).then(resolve);
+ document.body.removeChild(fileSelector);
})
+ document.body.appendChild(fileSelector);
fileSelector.click();
})
