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

Cannot bind elements by @Id when template extend Polymer.mixinBehavior #3277

Closed
oluwasayo opened this issue Jan 8, 2018 · 2 comments
Closed
Assignees
Milestone

Comments

@oluwasayo
Copy link
Contributor

Since Flow Alpha13, binding to elements by @Id when the template extends Polymer.mixinBehavior([Polymer.IronResizableBehavior], Polymer.Element) results in a "cannot read property my-id of undefined" in the browser console.

To reproduce:
Alpha12 works: https://github.com/oluwasayo/skeleton-starter-flow/tree/flow-alpha12-works
Alpha16 broken: https://github.com/oluwasayo/skeleton-starter-flow/tree/flow-alpha16-broken

Regression from: #3098

@manolo
Copy link
Member

manolo commented Jan 8, 2018

Related with #3264

@denis-anisimov
Copy link
Contributor

The example in the ticket description is technically invalid.
It uses Polymer.IronResizableBehavior mixin which is not imported by anything in the example and as a result ht behavior is not available (which can be seen in the browser console as a warning).
Nevertheless there is a bug in the Flow.
For some reasons when mixin is used the element may have root property but doesn't have $ property. And that causes the issue.
Even though the example is incorrect it still should work (ignoring non-existing) behavior.
One may just remove Polymer.IronResizableBehavior from the mixin declaration (and keep mixins array empty) and the issue still will be there though now the example is absolutely correct.

Resolution: we should check $ when it's needed, not only root property.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants