material icon indicating copy to clipboard operation
material copied to clipboard

$mdDialog broken in Chrome Version 35.0.1916.153 m since version 0.11

Open danivicario opened this issue 11 years ago • 2 comments

When opening a $mdDialog in Chrome 35 I get this exception

Uncaught TypeError: Cannot read property 'split' of undefined

angular-material.js:5000

Stack trace is

parseMaxTime angular-material.js:5000 computeTimings angular-material.js:4975 (anonymous function) angular-material.js:4878 (anonymous function) angular-material.js:5030 flush angular.js:13584

Debugging the code I have seen it is very easy to solve this issue by doing something like:

    function parseMaxTime(str) {
        var maxValue = 0;

        //fix
        if (typeof(str) === 'undefined'){
          str = '0s';
        }

        var values = str.split(/\s*,\s*/);

It seems older versions of Chrome are unable to get all the properties properly in these lines

    var tdr = parseMaxTime(cs[prop('transitionDuration')]);
    var adr = parseMaxTime(cs[prop('animationDuration')]);
    var tdy = parseMaxTime(cs[prop('transitionDelay')]);
    var ady = parseMaxTime(cs[prop('animationDelay')]);

Specifically "adr" is always undefined.

I can't upgrade the browser as it is a very closed environment but seems to me like an easy fix.

Thanks a lot

danivicario avatar Sep 14 '15 16:09 danivicario

The joy of Chrome and it's auto-updates is not dealing with these sorts of issues. I would not use Angular Material if you're trying to target Chrome 35. From README.md:

Angular Material is targeted for all browsers with versions n-1; where n is the current browser version.

langdonx avatar Sep 14 '15 18:09 langdonx

It looks like this was addressed last week: https://github.com/angular/material/commit/a5d84c372f87e96469f6c7d72d42d0aea83fe8fd#diff-1070b396d1eb6636d8b11b66a8b9d760L318

Closing for now- reopen if the bug remains.

jelbourn avatar Sep 16 '15 17:09 jelbourn