gwt-material icon indicating copy to clipboard operation
gwt-material copied to clipboard

MaterialImage Type Material Box throws an JS-Exception

Open DW-Saascom opened this issue 6 years ago • 2 comments

Hi, the Material-Box throws a JS-Exception if I zoom out. This Error occurs in the Demo too and is thrown from the materialiceJSDebug.js because the ancestorsChanged is undefined.

// Remove overflow overrides on ancestors
ancestorsChanged.css('overflow', '');

The Problem occurs in the Codes above this Line

        // Find ancestor with overflow: hidden; and remove it
        ancestorsChanged = undefined;
        ancestor = placeholder[0].parentNode;
        var count = 0;
        while (ancestor !== null && !$(ancestor).is(document)) {
          var curr = $(ancestor);
          if (curr.css('overflow') === 'hidden') {
            curr.css('overflow', 'visible');
            if (ancestorsChanged === undefined) {
              ancestorsChanged = curr;
            }
            else {
              ancestorsChanged = ancestorsChanged.add(curr);
            }
          }
          ancestor = ancestor.parentNode;
        }

Problem can be solved with:

// Remove overflow overrides on ancestors
if (ancestorsChanged !== undefined) {
    ancestorsChanged.css('overflow', '');
}

view debug

Is it possible to fix this Error?

DW-Saascom avatar Feb 13 '18 08:02 DW-Saascom

This could be a Materialize internal issue, will take a look if there are related issue about this.

kevzlou7979 avatar Apr 10 '18 14:04 kevzlou7979

IMHO we should wait for the official release of Materialize 1.0 for there internal fixes.

kevzlou7979 avatar Apr 19 '18 07:04 kevzlou7979