-
Notifications
You must be signed in to change notification settings - Fork 2k
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
detached
is called when an element with disable-upgrade
is removed from the page
#4550
Comments
Yes, this looks like a bug, since Just to understand better the use case: why are you detaching an element before it gets even upgraded? This looks like something that might lead to poor performance anyways, since you're creating elements in the wrong spot in the first place, right? |
Some parts of our single-page app are initially not visible but can become visible via user interaction. We heavily improved our performance by using We would like this issue to be fixed in a future Polymer update but since we are only experiencing problems in combination with the |
Thanks for the clarification 👌 @sorvell @kevinpschaaf any suggestions? |
Due to #4550, the feature has a flaw for native ES6 classes and would be better implemented as either a mixin or patch to `customElements.define`.
Agree this is a bug, and it should be pretty easily fixable in Polymer 1.x. However, it does point out a flaw in Polymer 2 class-based syntax, in that there is no easy way to prevent |
…readied.” This fixes an issue that allowed an element with `disable-upgrade` to process the `detached` callback.
Resolved in 1.x via #4607 |
Description
When removing an element with
disable-upgrade
from the page thedetached
method gets called. This can lead to errors if thedetached
method of the element or its behaviors relies on initialized properties (e.g. PolymerElements/iron-a11y-keys-behavior#71).In my opinion
detached
should never be called if the element hasdisable-upgrade
on it.Live Demo
Thanks to @valdrinkoshi for the jsbin:
http://jsbin.com/miqoxuf/3/edit?html,console,output
Steps to Reproduce
disable-upgrade
on it.Expected Results
detached
is not called, because the element hasdisable-upgrade
on it.Actual Results
detached
is called and can lead to errors.Browsers Affected
Versions
The text was updated successfully, but these errors were encountered: