Comments (5)
Adding document.body.appendChild(inputElement);
before inputElement.click();
in ngx-image-compress.js worked for me. I tested my app in iOS and Android devices and the issue seems to be solved. Thank you @nicovitt.
from ngx-image-compress.
Done in the new version 11.0.2
.
from ngx-image-compress.
Good insight.
Since you already have the proper environment and all the key of the problems, I propose you to make send a PR, that I will publish via npm.
If not I will make the correction myself, but I need organize some time, test from iOS, etc...
Whatever is the case: thank :)
from ngx-image-compress.
We ran into an issue where it is not working in iOS. We built an angular PWA and Safari has some issues by listening to the change event. There were no problems in Chrome or Firefox.
We found this related issue (https://stackoverflow.com/questions/47664777/javascript-file-input-onchange-not-working-ios-safari-only) and fixed the corresponding file "ngx-image-compress.js". Right beforeinputElement.click()
in theuploadFile()
method we implementeddocument.getElementById("mediacontainer").appendChild(inputElement);
.
For iOS the file has to be actually in the DOM so we append it to an element. Perhaps evendocument.appendChild(inputElement);
would work but we haven't tested this.Would it be possible to add this or something like this to your existing implementation?
Thanks, Nico
Heyy tried this method out but it didnt work for me. Would u mind sharing the code to see how u implement it if its working correctly
from ngx-image-compress.
Oh boys.
Didn't get the notification that I was mentioned here. Sorry for the late response. Thanks for implementing the fix @dfa1234 !
from ngx-image-compress.
Related Issues (20)
- uploadFile not resolving promise on PWA, isSafari incorrect value HOT 9
- file name when using uploadAndGetImageWithMaxSize HOT 1
- Require Angular 16? HOT 2
- Cannot compress image of 103kb to fit in 1mb HOT 5
- Compress Image with Max Size without use upload HOT 10
- ERROR Error: Uncaught (in promise): Event: {"isTrusted":true} HOT 4
- Slowdown on compress image with modified RegExp prototype HOT 1
- the pop-up window opens twice HOT 1
- Image turn black after Compression HOT 2
- just compress and resize if width bigger than a given value HOT 1
- filter gif images HOT 2
- Get access to the File names HOT 2
- Doesn't work with version 12 of Angular HOT 6
- Expose fileToDataURL Api publicaly HOT 1
- `cannot contain special characters` error in the console, sometimes happening HOT 4
- uploadFileOrReject not rejecting on Chrome on Android HOT 2
- Building a library alongside with Ivy and non-Ivy transpilation for retrocompatibility HOT 5
- File Object has to be emitted in the changeEvent like the traditional (onchange),,, to get the all file info.............. HOT 12
- Ivy update HOT 2
- generateUploadInputNative does not set the input element's Accept property to 'image/*' HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ngx-image-compress.