Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not working on IE 11 #445

Closed
Polm90 opened this issue Jun 28, 2018 · 23 comments
Closed

Not working on IE 11 #445

Polm90 opened this issue Jun 28, 2018 · 23 comments
Labels
documentation Needs to be documented in the readme or wiki help wanted info needed More info needs to be provided to discuss/solve the issue PR needed This issue requires a PR to be fixed. If you have time to help, please send a PR.

Comments

@Polm90
Copy link

Polm90 commented Jun 28, 2018

I''ve tried the demo https://lukasoppermann.github.io/html5sortable/index.html on IE11 (on Windows 10 with April Update) and nothing works. But in the console there are no errors.

Any help?

Thank you

@lukasoppermann lukasoppermann added help wanted info needed More info needs to be provided to discuss/solve the issue labels Jul 3, 2018
@lukasoppermann
Copy link
Owner

Hey @Polm90 sadly I have no windows machine available to easily debug this and I am pretty short on time. If you can help with figuring out what the problem could be and maybe even how to fix it, that would be great.

Any more info you can provide would be great.

@Polm90
Copy link
Author

Polm90 commented Jul 3, 2018

Unfortunately it's a strange behaviour because the browser gives no errors (or warnings - in console). But when you try to drag items as you do on other browsers, the browser selects/highlights the element (as you select some text) and there is no possibility to drag.

I didn't have time to try to figure out why, but if I'll find anything new I'll keep you update.

@jmartsch
Copy link

There are JavaScript errors in the console which I think are a result of using arrow functions, which are not supported in IE.
itemSerializer: (item, container) => { item.parent = '[parentNode]' item.node = '[Node]' item.html = item.html.replace('<','&lt;') return item }, ![iexplore_2018-07-21_02-51-01](https://user-images.githubusercontent.com/551551/43030482-eef1cd54-8c90-11e8-9c13-2a5e250c85a1.png)

@lukasoppermann
Copy link
Owner

Hey, there should not be any arrow functions in the code, as the code is converted which removes those error functions.

@jmartsch
Copy link

jmartsch commented Jul 21, 2018

Please take a look at the source code of the demo page @ https://lukasoppermann.github.io/html5sortable/index.html. In line 74 there is clearly an arrow function. And on line 80 and 85 also.

@lukasoppermann
Copy link
Owner

🤦‍♂️ I thought you were talking about the actual code of the sortable. Of course you are right here.

I remove them now, so does this fix the errors?

@jmartsch
Copy link

jmartsch commented Jul 21, 2018

The error is gone, but other errors still excist:
The object does not support the property or method "entries"
This error occurs five times on the page.
iexplore_2018-07-21_11-38-41

And on line 502 you make use of template strings, which are also not supported in IE.

@lukasoppermann
Copy link
Owner

Hey, could you maybe send a PR? I am out and I also have a Mac so I can't test on IE. That would be great. Thanks

@kretasei
Copy link

kretasei commented Aug 7, 2018

Unfortunately it's a strange behaviour because the browser gives no errors (or warnings - in console). But when you try to drag items as you do on other browsers, the browser selects/highlights the element (as you select some text) and there is no possibility to drag.

Same as Polm90, there's no error in the console but nothing is happening in IE11.

Internet Explorer version: 11.125.16299.0

@bgspooner
Copy link

I'm also having this issue; I would recommend you try what we use for IE testing, they have a free trial. https://www.browserstack.com

@lukasoppermann
Copy link
Owner

Hey, @bgspooner thanks for the comment. I currently do not have the capacity to investigate this issue. However if you can help providing a solution or even a PR I am happy to merge it.

@petrinecp
Copy link
Contributor

Hi, I've just created an issue #460 where I link a JSBin which demonstrates which polyfills are necessary for html5sortable to work in IE11.

@petrinecp
Copy link
Contributor

petrinecp commented Oct 5, 2018

So I looked at the API of the polyfill.io service and it turns out that it doesn't include Object.entries and Array.prototype.includes in the default configuration so you need to specify these two polyfills in the query string like so:
https://cdn.polyfill.io/v2/polyfill.js?features=default,Object.entries,Array.prototype.includes

See example https://jsbin.com/wivopiyoxu/edit?html,css,js,output

@lukasoppermann
Copy link
Owner

Awesome would you like to add a comment to the main readme file? That would be great.

@lukasoppermann lukasoppermann added the documentation Needs to be documented in the readme or wiki label Oct 9, 2018
@nilsenpaul
Copy link

With the above mentioned polyfill it works, until you try to drag anything. Then you get a bunch of errors about stores.values(), on multiple lines. Adding Object.values or Array.prototype.values to the polyfill makes no difference. Did anyone else have this?

@lukasoppermann lukasoppermann added the PR needed This issue requires a PR to be fixed. If you have time to help, please send a PR. label Oct 20, 2019
@crimson-med
Copy link

Is there any news about this?
I have added a polyfill for Object.assign and that worked but even using a polyfill for Object.entries I still get the error on IE11

@lukasoppermann
Copy link
Owner

hey @crimson-med can you paste the errors in here or link to a pastebin file?

@crimson-med
Copy link

@lukasoppermann I don't have access to my computer with IE11 right now. Will post over the weekend.

@lukasoppermann
Copy link
Owner

Great, since I personally don't have access to IE11 at all. Would be great if you can check it out and even better if you can send a PR or propose a solution that fixes it. Cheers

@crimson-med
Copy link

crimson-med commented Jun 16, 2020

I just got on IE11 and this is where I got the issue:

        Object.defineProperty(Store.prototype, "config", {
            /**
             * get the configuration map of a class instance
             * @method config
             * @return {object}
             */
            get: function () {
                // transform Map to object
                var config = {};
                this._config.forEach(function (value, key) {
                    config[key] = value;
                });
                // return object
                return config;
            },
            /**
             * set the configuration of a class instance
             * @method config
             * @param {object} config object of configurations
             */
            set: function (config) {
                if (typeof config !== 'object') {
                    throw new Error('You must provide a valid configuration object to the config setter.');
                }
                // combine config with default
                var mergedConfig = Object.assign({}, config);
                // add config to map
                this._config = new Map(Object.entries(mergedConfig));
            },
            enumerable: true,
            configurable: true
        });

More precisly this line:

 this._config = new Map(Object.entries(mergedConfig));

I can see the get uses foreach but not in the set for some reason.

@lukasoppermann
Copy link
Owner

Hey @crimson-med did you already try using a polyfill for maps?

@crimson-med
Copy link

@lukasoppermann I have tried using the polyfill mentioned in the documentation:

<script src="https://cdn.polyfill.io/v2/polyfill.min.js"></script>

As well as the mozilla object.entries polyfill:

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/entries

@lukasoppermann
Copy link
Owner

Hey @crimson-med,
it seems like the issue is the missing of map in older browsers (pre-es6).
See here: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map

If you don't want to use the mozilla polyfill for map you can look into this: https://www.npmjs.com/package/es6-map

Sadly I will not be able to look into it myself this week. If you make any progress please let me know, as we should add it to the readme (since it is currently missing).

Thanks & have a great week.

@lukasoppermann lukasoppermann closed this as not planned Won't fix, can't repro, duplicate, stale Aug 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Needs to be documented in the readme or wiki help wanted info needed More info needs to be provided to discuss/solve the issue PR needed This issue requires a PR to be fixed. If you have time to help, please send a PR.
Projects
None yet
Development

No branches or pull requests

8 participants