Skip to content

fix: Fluent-tabs .tabpanel missing "part attribute" #6539

@navinamat

Description

@navinamat

🐛 Bug Report

image

In the shadow root of the fluent-tabs component, the div with the class "tabpanel" is missing the part="tabpanel" attribute.

Instead the part="tabpanel" attribute has been added to the slot element within the div.
This means we are unable to select it in CSS and therefore are unable to style it.
The workaround below uses JavaScript to manually add and remove styles.

💻 Repro or Code Sample

🤔 Expected Behavior

Expected behavior
div class="tabpanel" part="tabpanel"

😯 Current Behavior

Current behavior (our workaround due to this bug):
Unable to access the tabpanel css since it is in the shadom-root with no "part" attribute
Due to this we are:

  • creating a @change listener to determine when a user changes tabs
    -parsing the data to determine the current tab is "home-tab"
  • adding and removing classes to the :host to add specific styles to the "home-tab" tabpanel
    -adding/removing classes when the connectedCallback() is called, so on refresh the correct styles are applied when the default tab ("home-tab") is open

932aa128-498d-49d8-ae19-870cdf3e5b74

5fd94e76-856f-4c0f-bc9a-6b24e06be378

💁 Possible Solution

div class="tabpanel" part="tabpanel"

🔦 Context

Instead the part="tabpanel" attribute has been added to the slot element within the div.
This means we are unable to select it in CSS and therefore are unable to style it.
The workaround below uses JavaScript to manually add and remove styles.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions