Just tried upgrading an element to native 2.0 class-based syntax and used Polymer.mixinBehaviors to mix Polymer.PaperInputBehavior this way, which in turn mixes in additional behaviors including Polymer.IronA11yKeysBehavior.
Unfortunately it seems that Polymer.mixinBehaviorsis not setting element's this.behaviors property, which is used by Polymer.IronA11yKeysBehavior, so it fails with an Error TypeError: Cannot read property 'map' of undefined error
I am not sure if any other PolymerElements/Behaviors make use of this property and if a change to Polymer.mixinBehaviors is warranted to maintain backward compatibility with hybrid Polymer Elements' behaviors or we shall treat it as a breaking API change.
As it stands right now it appears that this issue will get in the way of moving any element with a dependency on Polymer.IronA11yKeysBehavior to Polymer 2.0 class-based syntax.
Expected outcome
No error
Actual outcome
Error TypeError: Cannot read property 'map' of undefined
Description
Just tried upgrading an element to native 2.0 class-based syntax and used
Polymer.mixinBehaviors
to mixPolymer.PaperInputBehavior
this way, which in turn mixes in additional behaviors includingPolymer.IronA11yKeysBehavior
.Unfortunately it seems that
Polymer.mixinBehaviors
is not setting element'sthis.behaviors
property, which is used byPolymer.IronA11yKeysBehavior
, so it fails with anError TypeError: Cannot read property 'map' of undefined
errorhttps://github.com/PolymerElements/iron-a11y-keys-behavior/blob/2.0-preview/iron-a11y-keys-behavior.html#L374
I am not sure if any other PolymerElements/Behaviors make use of this property and if a change to
Polymer.mixinBehaviors
is warranted to maintain backward compatibility with hybrid Polymer Elements' behaviors or we shall treat it as a breaking API change.As it stands right now it appears that this issue will get in the way of moving any element with a dependency on
Polymer.IronA11yKeysBehavior
to Polymer 2.0 class-based syntax.Expected outcome
No error
Actual outcome
Error TypeError: Cannot read property 'map' of undefined
https://github.com/PolymerElements/iron-a11y-keys-behavior/blob/2.0-preview/iron-a11y-keys-behavior.html#L374
Live Demo
http://jsbin.com/gisakayogu/edit?html,console,output
This just shows that this.behaviors is undefined
Steps to reproduce
Browsers Affected