Skip to content
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
lacolaco:masterfrom
nud:master
Open

DynamicHTML: fix handling of imbricated components#24
nud wants to merge 1 commit into
lacolaco:masterfrom
nud:master

Conversation

@nud

@nud nud commented Jun 29, 2017

Copy link
Copy Markdown
Contributor

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:

  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 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 .

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>.
@nud

nud commented Aug 31, 2017

Copy link
Copy Markdown
Contributor Author

Hello @laco0416, any news on this one?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant