Data is reloaded when tab is changed

Data is reloaded when tab is changed

  

Hi,

In our mobile app we have web blocks inside tabs and the data and onReady event for the blocks are fired each time the respective tab is activated. Is there a way to not reload data when tabs are switched or we need to move all logic from web block to the block where tabs are?

Thank you.

Hi Mykola,

What kind of logic do you have in the OnReady? Do the blocks fetch data from the server?

Either way you can do what you suggested or create a tab control that instead of controlling its tabs visibility by removing hidden tabs content when their not active, you can just control the tab placeholder visibility with display (be aware that this might impact the performance of you screen as there will be more DOM nodes on the screen, even if not visible).

The thing is, blocks lifecycle is reset when they go away (are removed from DOM) and come back.