Famous/framework

Existing content is not replaced when node is yielded

Opened this issue · 1 comments

Take this example where a child component yields it's #header to the header in the parent component:

// Child component
behaviors: {
  '#header': {
    '$yield': '#title'
  }
},
tree: `<node id="header"><h1>Title</h1></node>`
// Parent component
tree: `
  <user:child>
    <node id='header">
      <h1>Different title</h1>
  </node>
</user:child>`

The content from the child #header is not replaced by the content from the parent. Instead both <h1>s are rendered.

Linguistically, at least, it would make better sense if when a node is directed to yield it completely hands over responsibility for what is rendered inside to the node it is yielding to.

@djgrant Thanks for bringing this to our attention. I'll look into this today.