Skip to content

Existing content is not replaced when node is yielded #51

Description

@djgrant

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.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions