Duplicated
Last Updated: 02 Mar 2020 13:28 by ADMIN
Robert
Created on: 08 Aug 2019 12:02
Category: TabStrip
Type: Feature Request
3
Request fro keepTabContent on TabStrip
There is no keepTabContent property for TabStrip. When setting that property to true in angular component, the component renders all tabs and they are persisted in the DOM.
I would like the same behavior for Blazor component.
Duplicated
This item is a duplicate of an already existing item. You can find the original item here:
4 comments
ADMIN
Marin Bratanov
Posted on: 09 Aug 2019 05:26
Hello Robert,

The only way I am aware of doing that at the moment is to use the scroll event of the div in order to store the information (see here, as it seems JS Interop will be needed). Whether you keep it on a server and set it through binding, or you use JS Interop and do this on the client (e.g., browser localStorage and restoring it when the component renders), is up to your preferences. It is not something the tab strip can or will do, however. Thus, I am marking this request as declined, because it pertains to state persistence of custom components and not to the tab strip.


Regards,
Marin Bratanov
Progress Telerik UI for Blazor
Robert
Posted on: 08 Aug 2019 18:49
Marin, Sorry I misspelled your name. It was a typo
Robert
Posted on: 08 Aug 2019 18:48
Martin, thank you for the replay. My goal is to keep state, but not so much the data but the UI state (eg. position of the scroll). Every time I change a tab, the component in currently active tab gets rerendered (reinitalized) and I lose UI state as mentioned..
ADMIN
Marin Bratanov
Posted on: 08 Aug 2019 15:52
Hello Robert,

At the moment, we are following the pattern where if a component does not need to be rendered - it isn't. This also goes for the animation container and the window popups, not just for the tab strip tabs. That's the general approach with Blazor right now, to keep the DOM as lightweight as possible.

That said, I am leaving this open so we can see whether there is interest in changing this or adding a feature to allow for maintaining the components active. I cannot say if it would be implemented, because browsers don't render hidden HTML anyway, so I am not sure there is a serious use case for this. If it is about keeping the state of components - this is something that their parent does usually, so the component where the tab strip is should take care of keeping alive data/flags that are needed for child content of the tab strip.


Regards,
Marin Bratanov
Progress Telerik UI for Blazor