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

Calling cancelUnbindAll is cumbersome under the CustomElements polyfill #312

Closed
sorvell opened this issue Oct 9, 2013 · 1 comment
Closed
Assignees

Comments

@sorvell
Copy link
Contributor

sorvell commented Oct 9, 2013

This issue came up in reference to #311. The intention is that the user updates the code to call cancelUnbindAll right after removeChild.

This works under native custom elements but not when using the polyfill. This is because the polyfill uses mutation observers to notice changes and they are asynchronous. Therefore, the user must call CustomElements.takeRecords() before cancelUnbindAll to force the CustomElements polyfill to see the change and process the leftViewCallback on the removed element. This is a problem because the code is polyfill aware.

We could improve this by: (1) making a preserveBindings property on polymer elements that would prevent unbindAll from being called, or (2) making cancelUnbindAll call CustomElements.takeRecords.

@ghost ghost assigned sorvell Oct 9, 2013
@sorvell
Copy link
Contributor Author

sorvell commented Oct 15, 2013

Here's where we landed on this. There's a preventDispose property on polymer elements. If set to true then elements will not unbind when they are removed from the document.

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

No branches or pull requests

1 participant