patternfly / patternfly-elements

PatternFly Elements. A set of community-created web components based on PatternFly design.
https://patternflyelements.org/
MIT License
375 stars 89 forks source link

TabsController should not make assumptions about host's DOM #2695

Closed bennypowers closed 4 months ago

bennypowers commented 4 months ago

In TabsController's #rebuild() method:

const tabSlot = this.#element.shadowRoot?.querySelector<HTMLSlotElement>('slot[name=tab]');
const panelSlot = this.#element.shadowRoot?.querySelector<HTMLSlotElement>('slot:not([name])');

In order that tabs controller be applicable to any tabs implementation, these should be replaced with getter functions in the options.

We should also consider removing the dependency on expand / disabled events and the active property in a similar manner