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

Exception thrown when adding event handlers to buttons inside <paper-dialog> element #20931

Closed
DartBot opened this issue Sep 12, 2014 · 13 comments
Assignees
Labels
area-pkg Used for miscellaneous pkg/ packages not associated with specific area- teams. P1 A high priority bug; for example, a single project is unusable or has many test failures

Comments

@DartBot
Copy link

DartBot commented Sep 12, 2014

This issue was originally filed by pru...@gmail.com


What steps will reproduce the problem?
Example shown here on SO: http://stackoverflow.com/questions/25800082/how-to-know-which-button-the-user-selected-on-paper-dialog

What is the expected output? What do you see instead?
I would expect this to work with no exceptions thrown, but after I click a button to close the dialog, I get:

Uncaught Uncaught Error: Bad state: controller overlay-host is not a Dart polymer-element.
Stack Trace:
Bad state: controller overlay-host is not a Dart polymer-element.
    at dart.wrapException (http://192.168.1.68:8081/index.html_bootstrap.dart.js:2588:15)
    at PolymerEventBindings_getEventHandler_closure.call$1 (http://192.168.1.68:8081/index.html_bootstrap.dart.js:24435:17)
    at _RootZone.runUnaryGuarded$2 (http://192.168.1.68:8081/index.html_bootstrap.dart.js:9865:18)
    at _RootZone_bindUnaryCallback_closure.call$1 (http://192.168.1.68:8081/index.html_bootstrap.dart.js:9986:26)
    at PolymerEventBindings_prepareEventBinding__closure.call$2 (http://192.168.1.68:8081/index.html_bootstrap.dart.js:24456:34)
    at dart.Primitives_applyFunction (http://192.168.1.68:8081/index.html_bootstrap.dart.js:2572:23)
    at _callDartFunction (http://192.168.1.68:8081/index.html_bootstrap.dart.js:18147:29)
    at paper-button.<anonymous> (http://192.168.1.68:8081/index.html_bootstrap.dart.js:18136:16)

What version of the product are you using?
Dart 1.6.0, Polymer 0.13.0.+3

On what operating system?
Windows 8 64-bit

What browser (if applicable)?
Chrome

Please provide any additional information below.

@sethladd
Copy link
Contributor

Added Pkg-Polymer, Area-Pkg, Triaged labels.

@jakemac53
Copy link
Contributor

Set owner to @jakemac53.
Added Started label.

@jakemac53
Copy link
Contributor

I was unable to get a repro on this by creating an element with the example template and functions, would it be possible for you to post a full project that contains the repro?


Added NeedsInfo label.

@DartBot
Copy link
Author

DartBot commented Sep 18, 2014

This comment was originally written by pruj...@gmail.com


The project where this is occurring is currently closed source. It's really odd, because the event handler method on the buttons is called just fine, but the above exception displays every time. When I remove the event handlers from the element, clicking the buttons doesn't give the error. Sorry, wish I could help more.

I've attached the Polymer element in question, along with it's code-behind file. Perhaps that may be of some use.


Attachment:
alert.zip (1.38 KB)

@DartBot
Copy link
Author

DartBot commented Sep 18, 2014

This comment was originally written by prujoh...@gmail.com


Removed an unneeded reference in the polymer file.


Attachment:
alert.zip (1.40 KB)

@jakemac53
Copy link
Contributor

Ah perfect, the actual issue is with the layered="true" attribute on the dialog. This rips out the shadow root from your element and puts it inside a different core-overlay-layer element which it then tries to call the method on (and fails because not only does it not exist but that is not a dart element).

I will do some more investigation and see if this is a bug on the JS side of things as well, or something dart-specific.


Added Started label.

@jakemac53
Copy link
Contributor

Removed Priority-Unassigned label.
Added Priority-High label.

@jakemac53
Copy link
Contributor

Definitely looks to be a dart issue, can't get a repro on the js side alone

@jakemac53
Copy link
Contributor

Fix pending https://codereview.chromium.org/582113002/

@DartBot
Copy link
Author

DartBot commented Sep 18, 2014

This comment was originally written by pruj...@gmail.com


Thanks for the quick resolution!

@jakemac53
Copy link
Contributor

No problem, thanks for the bug report!

Fixed in r40458 and released as 0.14.2+1.


Added Fixed label.

@DartBot
Copy link
Author

DartBot commented Sep 18, 2014

This comment was originally written by pr...@gmail.com


Confirmed 0.14.2+1 fixes my issue.

@DartBot DartBot added Type-Defect P1 A high priority bug; for example, a single project is unusable or has many test failures area-pkg Used for miscellaneous pkg/ packages not associated with specific area- teams. labels Sep 18, 2014
@DartBot
Copy link
Author

DartBot commented Jun 5, 2015

This issue has been moved to dart-archive/polymer-dart#296.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-pkg Used for miscellaneous pkg/ packages not associated with specific area- teams. P1 A high priority bug; for example, a single project is unusable or has many test failures
Projects
None yet
Development

No branches or pull requests

3 participants