Re: [w3c/webcomponents] [Shadow] Slotting indirect children (#574)

@hayatoito, right, the parent would be a no-op. However, this does not make it useless. For example, if you want to remove, move or add a tab, then you could do this with one command. Therefore, this is important to keep the tab titles and contents grouped and synchronized.

Adding a shadow to `my-tab` does not allow me to achieve the desired composed DOM (see the issue description). If the slot name exists as a slot in the direct parent, then it would behave as normal nested components.

Angular Martial Design uses a similar markup:

[Angular 2](https://www.npmjs.com/package/@angular2-material/tabs):
```html
<md-tab-group>
  <md-tab>
    <template md-tab-label>One</template>
    <template md-tab-content>
      <h1>Some tab content</h1>
      <p>...</p>
    </template>
  </md-tab>
  <md-tab>
    <template md-tab-label>Two</template>
    <template md-tab-content>
      <h1>Some more tab content</h1>
      <p>...</p>
    </template>
  </md-tab>
</md-tab-group>
```

[Angular 1](https://material.angularjs.org/latest/api/directive/mdTabs):
```html
<md-tabs md-selected="selectedIndex">
  <img ng-src="img/angular.png" class="centered">
  <md-tab ng-repeat="tab in tabs | orderBy:predicate:reversed" md-on-select="onTabSelected(tab)" md-on-deselect="announceDeselected(tab)" ng-disabled="tab.disabled">
    <md-tab-label>
      {{tab.title}}
      <img src="img/removeTab.png" ng-click="removeTab(tab)" class="delete">
    </md-tab-label>
    <md-tab-body>
      {{tab.content}}
    </md-tab-body>
  </md-tab>
</md-tabs>
```

Please keep in mind that even if `<my-tab-title>`/`<my-tab-content>` were just regular elements, it would still not be possible to slot them somewhere else. This is a serious limitation of this specification.

Do you have a better idea how to solve this problem than my suggested algorithm?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/webcomponents/issues/574#issuecomment-251391410

Received on Tuesday, 4 October 2016 13:44:58 UTC