PolymerElements / paper-behaviors

Common behaviors used across paper-* elements.
19 stars 27 forks source link

domContainer.deepContains is not a function #65

Closed lukaskrs closed 8 years ago

lukaskrs commented 8 years ago

Hi Polymer team,

In the console log, there is a tendency to get this error: Uncaught TypeError: domContainer.deepContains is not a function

(paper-ripple-behavior.html line 86)

by adding this type checking line, will remove error from browser console if (typeof domContainer.deepContains === 'function') { // then do the domContainer.deepContains call }

image

keanulee commented 8 years ago

Hi @lukaskrs,

deepContains() is a method provided by Polymer (https://github.com/Polymer/polymer/blob/master/src/lib/dom-api.html#L46). If you are seeing this issue, can you reproduce and provide a link to a JSBin?

lukaskrs commented 8 years ago

Hi @keanulee,

It might be a possibility that line 84 (paper-ripple-behaviour.html) var domContainer = Polymer.dom(this._rippleContainer || this);

didn't get the right domContainer. This is domContainer that was grabbed by that line. I copied the value from console.log(domContainer) DomApi {node: paper-button.style-scope.a-journal.x-scope.paper-button-0}

childNodes: (...) children: (...) classList: (...) firstChild: (...) firstElementChild: (...) innerHTML: (...) lastChild: (...) lastElementChild: (...) nextElementSibling: (...) nextSibling: (...) node: paper-button.style-scope.a-journal.x-scope.paper-button-0 parentNode: (...) previousElementSibling: (...) previousSibling: (...) textContent: (...) proto: Object

keanulee commented 8 years ago

Please provide example code that reproduces this, and give details on what OS/browser. Here's a snippet to get started: http://jsbin.com/teyacanomi/edit?html,output

MGRProgramming commented 8 years ago

Same thing here, apparently only with fresh bower install of paper-button. Code below works with an earlier bower install.

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Test for Button</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width">
  <script src="/bower_components/webcomponentsjs/webcomponents-lite.js"></script>
  <link rel="import" href="/bower_components/paper-button/paper-button.html">  
</head>
<body>
  <paper-button raised raised>Hello</paper-button>
</body>
</html>

Both bower.json files in the the two paper-button directories show version 1.0.11. But the github pages shows changes in paper-button.html 2 weeks ago ("Remove unneeded CSS style") P.S. Also no problem with polymer-cdn v1.2.3.2

keanulee commented 8 years ago

Still unable to reproduce - did you bower update? Can you specify what browser you're using?

Updated link to use polygit2: http://jsbin.com/gumoreqeno/edit?html,output

lukaskrs commented 8 years ago

Hi Keanu,

I'm using latest version of google chrome on Windows. With all paper button dependencies updated to the latest version in bower. I will try to see if I can do something later today to make code example in about an hour.

On Wed, Feb 24, 2016 at 11:51 AM -0800, "Keanu Lee" notifications@github.com wrote:

Still unable to reproduce - did you bower update? Can you specify what browser you're using?

Updated link to use polygit2: http://jsbin.com/gumoreqeno/edit?html,output

— Reply to this email directly or view it on GitHub.

lukaskrs commented 8 years ago

Hi Keanu,

Please see the sample code here. http://test.hagajaya.id/

I have confirmed that the issue only arise if you updated the bower_components/polymer into the latest version. Let me know if you believe the bug is a polymer bug, Thanks for your help.

Cheers, Lukas

suneelv commented 8 years ago

I had the same issue, updating polymer from 1.2.3 to 1.3.0 fixed that. Hope it helps you.

I saw the same bug, with this configuration

bower.json config "polymer": "Polymer/polymer#1.2.3", "paper-elements": "PolymerElements/paper-elements#1.0.0"

Browser: chrome latest, OS : Windows 10

keanulee commented 8 years ago

@lukaskrs Please use the latest version of Polymer (v1.3.0 at time of writing). The sample link/code you provided uses an older version (v1.2.0). Thanks for the pointer @suneelv!