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

Failure when extending a class that includes behavior mixins #4437

Closed
2 tasks done
coreyfarrell opened this issue Mar 16, 2017 · 1 comment
Closed
2 tasks done

Failure when extending a class that includes behavior mixins #4437

coreyfarrell opened this issue Mar 16, 2017 · 1 comment

Comments

@coreyfarrell
Copy link
Contributor

Description

Extending a base class which extends Polymer.mixinBehaviors results in failure (at least with iron-a11y-key-behaviors).

Live Demo

I could not get jsfiddle / others to work with Polymer 2.0 so I had to create a gh-pages repo.
View: https://coreyfarrell.github.io/broken-test/
Source: https://github.com/coreyfarrell/broken-test/

Steps to Reproduce

See index.html from broken-test repo for minimal test case.
When loading the page, press "enter" within the first edit box shown. This will attempt to create the second edit box, which will fail. Check the error console for details.

Expected Results

Creating my-element1 and my-element2 should work without error.

Actual Results

The first created element functions, the second throws an error. Creating the same element multiple times works fine, for example:
<my-element1></my-element1><my-element1></my-element1>

Creating both my-element1 and my-element2 will only succeed on the first element created. Any further elements that are created will not call registered in the behavior, thus causing iron-a11y-key-behavior to fail when attached is run.

The order of declaration for the elements makes no difference, only the first class to have an instance created will succeed.

Browsers Tested/Affected

  • Chrome
  • Firefox

Versions

  • Polymer: v2.0.0-rc.3
  • webcomponents: v1.0.0-rc.6
@sorvell
Copy link
Contributor

sorvell commented Mar 16, 2017

Yes, can confirm this issue. It's related to how we call registered when extending classes. We'll work on a fix.

sorvell pushed a commit that referenced this issue Mar 16, 2017
… using `LegacyElementMixin`. Ensure that a behaviors’s `registered` method is called for any extending class.
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

3 participants