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

Deckgrid does not work in IE11 #86

Open
GaryWenneker opened this issue Jun 24, 2015 · 6 comments
Open

Deckgrid does not work in IE11 #86

GaryWenneker opened this issue Jun 24, 2015 · 6 comments

Comments

@GaryWenneker
Copy link

a client reminded me of a page not rendering.
when looking further it showed that Chrome, FF etc were working fine.
I found out that it had to do with the initialization of the content variable.
before parsing the content var I added a console.log(content) and suddenly the page came to life (weird!!!). Because I didn't want to leave the console.log in the code I added this:

if(content) {
                content = $.extend(true,{},content);
                content = content.content;
            }

this hack magically works so I hope others will benefit from it.
Better solutions are welcome :-)

@Ajianz
Copy link

Ajianz commented Jul 3, 2015

We are facing the same issue. Our application is not loading in IE11, getting the below error in console,
angular-deckgrid: No CSS configuration found (see https://github.com/akoenig/angular-deckgrid#the-grid-configuration).

Could you please let us know any solution available for this or please let us know where this hack can be applied.

Thanks in advance!

@praabjerg
Copy link

Same here.
This seems to be a somewhat bizarre issue with the latest IE11 update. The relevant bit of code in deckgrid is this:

        Deckgrid.prototype.$$getLayout = function $$getLayout () {
            var content = $window.getComputedStyle(this.$$elem, ':before').content,
                layout;

            if (content) {
                content = content.replace(/'/g, '');  // before e.g. '3 .column.size-1of3'
                content = content.replace(/"/g, '');  // before e.g. "3 .column.size-1of3"
                content = content.split(' ');

                if (2 === content.length) {
                    layout = {};
                    layout.columns = (content[0] | 0);
                    layout.classList = content[1].replace(/\./g, ' ').trim();
                }
            }

            return layout;
        };

If you exchange the first three lines of the function with this:

        Deckgrid.prototype.$$getLayout = function $$getLayout () {
            var styles = $window.getComputedStyle(this.$$elem, ':before'),
                layout, content;
            // console.log(styles);
            content = styles.content;

and then use the debugger to inspect respectively the styles and content variables, you'll note that the styles.content attribute exists, but seems to disappear into a 'none' string when you try to assign it.
However, if you try to print the styles variable with console.log before you assign it to the content variable, it works!

I am deeply puzzled.

(Edit: Added an outcommented console.log(styles) to illustrate)

@praabjerg
Copy link

GaryWenneker's workaround seems to work, though you have to extract the CSSStyleDeclaration first, like I do above. In the context of my example:

        Deckgrid.prototype.$$getLayout = function $$getLayout () {
            var styles = $window.getComputedStyle(this.$$elem, ':before'),
                layout, content;
            styles = $.extend(true,{},styles);
            content = styles.content;

As far as I can see though, this workaround is dependent on having a full jQuery available. I don't think the jQuery Lite that comes with Angular includes .extend, and angular.extend doesn't seem to work in the same way.

@yamafaktory
Copy link

@praabjerg workaround successfully corrects the issue. Thanks!

@Ajianz
Copy link

Ajianz commented Jul 8, 2015

yo! It worked...Thanks!

@tcdevs
Copy link

tcdevs commented Aug 13, 2015

Here is some additional info:
The bug only seems to occur with IE11 version:11.0.9600.17843 - update version: 11.0.20. When you use IE11 version: 11.9600.17914 -update version: 11.0.21 it works.

@praabjerg Thanks for the fix.

This was referenced Sep 5, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants