On 12/11/16, 1:11 AM, "[email protected] on behalf of Carlos Rovira"
<[email protected] on behalf of [email protected]> wrote:

>Hi,
>
>just committed a InnerHTML bead that solves one of my main concerns with
>how to output HTML from MXML/AS in any component
>
>Right now the text is always added first (due to flexjs component life
>cycle).
>Just found that maybe users would want to get the text after some other
>nodes added and just read a Yishaw response on "beadsAdded" event that I
>think could help with that.
>
>I think this will make me clean or remove some components I did that would
>benefit from this. For example, now tags like js:H1 will not need to have
>a
>text property, and js:Div will be redundant in favor of js:Container (or
>maybe we want to maintain a js:Div?)

That's clever (adding new properties as beads).  For this particular
implementation, are you concerned about collisions in other scenarios?
For Div/Container (probably others), adding children also modified
innerHTML.  

Would it be useful to have a component that generates a TextNode?  Then
you could interleave them between other child components.

IMO, a Container is a general purpose container of child components.  Yes,
we currently use Div for it in HTML, but other platforms may have
different behavior.  It turns out that you can write to innerHTML to set
children and text/html in JS, but it isn't clear that a Container should
support a text/html property.  A Div component could, but again, I think
it should just accept children.  A DivForHTML component could expose an
innerHTML property and not subclass Container so that you can't add
children and conflict with the innerHTML property.

Just thinking out loud...  I could be wrong,
-Alex

Reply via email to