pqina / filepond-plugin-image-preview

🖼 Show a preview for images dropped on FilePond
https://pqina.nl/filepond
MIT License
47 stars 27 forks source link

IE11 Support #4

Closed mneuhaus closed 6 years ago

mneuhaus commented 6 years ago

i know, it's ancient, but i think it could be supported with minimal effort, the main Problem is the dispatchEvent at the bottom :)

It fails with "Object doesn't support this action" which lead me here: https://stackoverflow.com/questions/27176983/dispatchevent-not-working-in-ie11

i "worked around" in my local installation with simply doing this:

any chance you could make this plugin work with IE11? :)

rikschennink commented 6 years ago

It should already work in IE11 :-)

Have you added the polyfill package?

rikschennink commented 6 years ago

Closed because of no response. Local tests show image preview functions correctly.

derekhewitt commented 6 years ago

Sorry to open this back up, I have tried with the polyfill package and am still not able to get it to work in IE 11, it looks like same as the screenshot below from your website. image

rikschennink commented 6 years ago

No problem @derekhewitt can you try adding:

<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-core/5.6.15/browser-polyfill.min.js"></script>

By the way, I'm currently not supporting IE11 on de product page.

derekhewitt commented 6 years ago

Thanks @rikschennink , that fixed the display issue. Uploading a file now sticks on "waiting for size" with an error in the dev tools "Unhandled promise rejection error: incorrect function", even though I have the promise polyfill.

rikschennink commented 6 years ago

It's so strange because it does work in my test environment :)

I'm going to take a look at this over the weekend, will get back to you, ASAP.

rikschennink commented 6 years ago

@derekhewitt sorry for the delay.

I've just tested and it works fine on my IE11 VM with this setup:

<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-core/5.6.15/browser-polyfill.min.js"></script>

<script src="filepond-polyfill.min.js"></script>
<script src="filepond-plugin-image-preview.js"></script>
<script src="filepond.js"></script>

<script>
        FilePond.registerPlugin(FilePondPluginImagePreview);

        [].slice.call(document.querySelectorAll('input')).forEach(function(el) {
            const pond = FilePond.create(el,{
                server: 'http://192.168.33.11'
            });
        })
</script>

See screenshot, the version seems to be the same as yours.

screen shot 2018-09-25 at 11 05 03

derekhewitt commented 6 years ago

Thanks @rikschennink , I must have been doing something wrong - I was able to successful upload an image now. Thanks for all your help.

BMCwebdev commented 3 years ago

For people who end up here searching for an answer to this or similar problems, I solved it by using the following: https://www.npmjs.com/package/custom-event-polyfill