This repository was archived by the owner on May 20, 2019. It is now read-only.
DynamicHTML: fix handling of imbricated components#24
Open
nud wants to merge 1 commit into
Open
Conversation
If a component known by DynamicHTMLModule is embedded within another
known component within a <dynamic-html> content, what will happen
(depending on the declaration order of components) is:
1. a component will be created for the inner element
2. a component will be created for the outer element
3. the (post-rendering) innerHTML will be passed to the outer
component, but any behaviour will be lost
The correct way to handle this case is to use a <dynamic-html> tag again
within the outer component, but since it is the post-rendering innerHTML
that is passed to it, it means the inner component will likely not
recognize the innerHTML that gets passed to it. Also it gets rendered
twice, which is useless.
This commit fixes that behaviour by ensuring a component selector is not
embedded in another known component before creating it. It prevents the
instantiation of extra useless components and fixes using <dynamic-html>
within <dynamic-html>.
Contributor
Author
|
Hello @laco0416, any news on this one? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
If a component known by DynamicHTMLModule is embedded within another
known component within a content, what will happen
(depending on the declaration order of components) is:
component, but any behaviour will be lost
The correct way to handle this case is to use a tag again
within the outer component, but since it is the post-rendering innerHTML
that is passed to it, it means the inner component will likely not
recognize the innerHTML that gets passed to it. Also it gets rendered
twice, which is useless.
This commit fixes that behaviour by ensuring a component selector is not
embedded in another known component before creating it. It prevents the
instantiation of extra useless components and fixes using
within .