Giter VIP home page Giter VIP logo

Comments (5)

amunguia90 avatar amunguia90 commented on August 16, 2024 1

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.

dfa1234 avatar dfa1234 commented on August 16, 2024 1

Done in the new version 11.0.2.

from ngx-image-compress.

dfa1234 avatar dfa1234 commented on August 16, 2024

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.

sedaplaksa avatar sedaplaksa commented on August 16, 2024

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 before inputElement.click() in the uploadFile() method we implemented document.getElementById("mediacontainer").appendChild(inputElement);.
For iOS the file has to be actually in the DOM so we append it to an element. Perhaps even document.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.

nicovitt avatar nicovitt commented on August 16, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.