Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Providing Content for a Named Slot Conflicts With Fallback Content for a Nameless Slot #1

Open
daniel-nagy opened this issue May 5, 2019 · 1 comment

Comments

@daniel-nagy
Copy link
Contributor

When providing content for a named slot, if there is any whitespace it will be slotted to the default slot and the default slot's fallback content will not be rendered.

e.g.

@customElement('x-element')
class XElement extends LitElement {
  render() {
    return html`
      <v-slot>
        <v-slot-fallback-content>Test</v-slot-fallback-content>
      </v-slot>
      <v-slot name="other-slot"></v-slot>
    `;
  }
}
<x-element>
  <div v-slot="other-slot">Other Content</div>
<x-element>

Empty text nodes will be created and slotted to the nameless slot, preventing the fallback content from rendering.

@daniel-nagy
Copy link
Contributor Author

A workaround would be to assign a name to each slot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant