MudBlazor/MudBlazor

MudTabs - TabPanel RenderingMode

Closed

#6,742 opened on Apr 26, 2023

 (2 comments) (1 reaction) (0 assignees)C# (1,631 forks)batch import
enhancementhelp wanted

Repository metrics

Stars
 (10,394 stars)
PR merge metrics
 (Avg merge 6d 6h) (108 merged PRs in 30d)

Description

Feature request type

Enhance component

Component name

MudTabs

Is your feature request related to a problem?

MudTabs provides two rendering mechanisms for a MudTabPanel. The first one is rendering the current selected TabPanel that releases its content when we switch to another tab. The second one is rendering all TabPanels on initialization that keeps the content in the DOM. This behavior is controlled by the "KeepTabsAlive" flag.

Sometimes, you need to control which tab should be active and which should be re-rendered when the user is accessing it. Also, to decrease initial costs, we must be able to lazy load a container once and keep the panel up.

With the current implementation you can get either black or white.

Describe the solution you'd like

Each MudTabPanel should have a flag called "RenderMode".

RenderMode can have the following options

Default => the current implementation - The content remains according to the KeepTabsAlive flag

Lazy => TabPanel is rendered when the user is accessing it for the first time (KeepTabsAlive must be true) - The content remains

Immediate => TabPanel will be rendered when MudTabs are rendered (default behavior if KeepTabsAlive is true) - The content remains

Always => TabPanel will always be (re)rendered when the user is accessing it (KeepTabsAlive is not mandatory) - The content does not remain

This way, we don´t have breaking changes and the user can define its rendering strategy for each tab.

Have you seen this feature anywhere else?

No response

Describe alternatives you've considered

No response

Pull Request

  • I would like to do a Pull Request

Code of Conduct

  • I agree to follow this project's Code of Conduct

Contributor guide