RadzenTabs - selected tab styling incorrect with hidden tabs #869

Closed
opened 2026-01-29 17:45:36 +00:00 by claunia · 0 comments
Owner

Originally created by @0xor1 on GitHub (Jun 1, 2023).

Describe the bug
RadzenTabs selected tab styling shows incorrect tab as selected when you have Visible="false" on one or more RadzenTabsItem

To Reproduce
Steps to reproduce the behavior:

<RadzenTabs RenderMode="TabRenderMode.Client">
    <Tabs>
        <RadzenTabsItem Text="A">
            <p>A</p>
        </RadzenTabsItem>
        <RadzenTabsItem Text="B" Visible="false">
            <p>B</p>
        </RadzenTabsItem>
        <RadzenTabsItem Text="C">
            <p>C</p>
        </RadzenTabsItem>
        <RadzenTabsItem Text="D">
            <p>D</p>
        </RadzenTabsItem>
    </Tabs>
</RadzenTabs>

This only appears to happen when using RenderMode="TabRenderMode.Client" when I dont specify I did not observe the bug

Expected behavior
the correct selected styling should be applied to the tab that you click on and is infact selected.

Screenshots
image
image
image

Additional context

internal bool IsSelected(RadzenTabsItem tab) => this.IndexOf(tab) == this.selectedIndex;

this appears to not take into account hidden i.e. Visible="false" tabs.

Originally created by @0xor1 on GitHub (Jun 1, 2023). **Describe the bug** `RadzenTabs` selected tab styling shows incorrect tab as selected when you have `Visible="false"` on one or more `RadzenTabsItem` **To Reproduce** Steps to reproduce the behavior: ``` <RadzenTabs RenderMode="TabRenderMode.Client"> <Tabs> <RadzenTabsItem Text="A"> <p>A</p> </RadzenTabsItem> <RadzenTabsItem Text="B" Visible="false"> <p>B</p> </RadzenTabsItem> <RadzenTabsItem Text="C"> <p>C</p> </RadzenTabsItem> <RadzenTabsItem Text="D"> <p>D</p> </RadzenTabsItem> </Tabs> </RadzenTabs> ``` This only appears to happen when using `RenderMode="TabRenderMode.Client"` when I dont specify I did not observe the bug **Expected behavior** the correct selected styling should be applied to the tab that you click on and is infact selected. **Screenshots** ![image](https://github.com/radzenhq/radzen-blazor/assets/1579330/a9cc8764-f396-4f7f-89b6-138fb52e0e5d) ![image](https://github.com/radzenhq/radzen-blazor/assets/1579330/bf9d34f3-5abd-4be2-a73f-01423f547b0e) ![image](https://github.com/radzenhq/radzen-blazor/assets/1579330/a8dd2f3c-2dec-43de-bad2-db565493dcae) **Additional context** ``` internal bool IsSelected(RadzenTabsItem tab) => this.IndexOf(tab) == this.selectedIndex; ``` this appears to not take into account hidden i.e. `Visible="false"` tabs.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/radzen-blazor#869