googlearchive / paper-dialog

A dialog à la Material Design
19 stars 16 forks source link

TypeError: Cannot read property 'teardown' of undefined #32

Closed mchandleraz closed 9 years ago

mchandleraz commented 9 years ago

I'm using paper-dialog and getting the following error in Chrome:

Exception caught during observer callback: TypeError: Cannot read property 'teardown' of undefined

stack trace is here: http://cl.ly/image/102q2V1j212F

I've replaced my paper-dialog implementation with one from the docs, and am still getting the error. I've got Polymer 0.4.2.

orva commented 9 years ago

This bug seems to trigger if component using paper-dialog doesn't import paper-dialog/paper-dialog-transition.html. Even adding import for transition component and not using them is enough to fix the situation, thus transitions aren't optional like documentation says they are (see below).

Transitions

<paper-dialog> can be used with <paper-transition> to transition the overlay open and close.
To use a transition, import paper-dialog-transition.html alongside paper-dialog:
sunglim commented 9 years ago

@orva 's method fixes this issue. Document should be updated.

orva commented 9 years ago

I don't think documentation update itself isn't enough. How I see it there is two options how to fix the issue:

  1. Change paper-dialog so it doesn't have dependency to paper-dialog-transition
  2. Make transition dependency to be hard dependency: change paper-dialog to import transition module by itself and then update documentation to reflect this change (no need to import transition module, how to use them with component).

As far as I see it option 2 would might better fit, as user of the dialog probably wants to have some kind of neat transition anyways. So the extra step to import transition component feels just unnecessary. Also that change is trivial and isolated to paper-dialog (even I could PR that without need to dig into other components which paper-dialog is using).

sunglim commented 9 years ago

:+1: upvote orva's 2nd method.

adrianenriquez commented 9 years ago

Thanks for the quick fix. +1 @orva

morethanreal commented 9 years ago

This should be fixed.