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

TypeError thrown when adding/removing ripple from DOM #84

Open
ronnyroeller opened this issue Jun 22, 2016 · 0 comments
Open

TypeError thrown when adding/removing ripple from DOM #84

ronnyroeller opened this issue Jun 22, 2016 · 0 comments

Comments

@ronnyroeller
Copy link

Description

Rolling back to paper-ripple 1.0.5 solves the problem, i.e. it was introduced in 1.0.6.

The keyEventTarget is set to null when the ripple is removed from the DOM. Adding the ripple back to the DOM causes the following error in the console:

error TypeError: Cannot read property 'addEventListener' of null
    at paper-ripple.<anonymous> (https://polygit.org/components/iron-a11y-keys-behavior/iron-a11y-keys-behavior.html:404:30)
    at Array.forEach (native)
    at paper-ripple._listenKeyEventListeners (https://polygit.org/components/iron-a11y-keys-behavior/iron-a11y-keys-behavior.html:398:40)
    at paper-ripple.attached (https://polygit.org/components/iron-a11y-keys-behavior/iron-a11y-keys-behavior.html:298:14)
    at paper-ripple._invokeBehavior (https://polygit.org/components/polymer/polymer-micro.html:433:4)
    at paper-ripple._doBehavior (https://polygit.org/components/polymer/polymer-micro.html:426:6)
    at https://polygit.org/components/polymer/polymer-micro.html:210:6
    at Object.whenReady (https://polygit.org/components/polymer/polymer-micro.html:103:1)
    at paper-ripple.attachedCallback (https://polygit.org/components/polymer/polymer-micro.html:208:22)
    at paper-ripple.attachedCallback (https://polygit.org/components/polymer/polymer-mini.html:104:22)

Now, removing the ripple again from the DOM causes this error:

error TypeError: Cannot read property 'removeEventListener' of null
    at paper-ripple._unlistenKeyEventListeners (https://polygit.org/components/iron-a11y-keys-behavior/iron-a11y-keys-behavior.html:421:25)
    at paper-ripple.detached (https://polygit.org/components/iron-a11y-keys-behavior/iron-a11y-keys-behavior.html:302:14)
    at paper-ripple._invokeBehavior (https://polygit.org/components/polymer/polymer-micro.html:433:4)
    at paper-ripple._doBehavior (https://polygit.org/components/polymer/polymer-micro.html:426:6)
    at https://polygit.org/components/polymer/polymer-micro.html:217:6
    at Object.whenReady (https://polygit.org/components/polymer/polymer-micro.html:103:1)
    at paper-ripple.detachedCallback (https://polygit.org/components/polymer/polymer-micro.html:215:22)
    at Object.removeChild (https://polygit.org/components/polymer/polymer-mini.html:568:26)
    at Object.removeChild (https://polygit.org/components/polymer/polymer-mini.html:775:18)
    at dom-bind.scope.toggle (https://null.jsbin.com/runner:9:37)

Expected outcome

Ripple can be added and remove from the DOM without throwing errors in the console.

Actual outcome

screenshot from 2016-06-22 09-42-01

Live Demo

https://jsbin.com/kowecehexi/edit?html,output

Steps to reproduce

  1. Open JSbin
  2. Open browser console
  3. Click [hide] button
  4. Click [show] button
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

1 participant