Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix lazy loading in Tab component #1827

Closed
1 of 2 tasks
ESadouski opened this issue Jul 17, 2019 · 4 comments · Fixed by #2827
Closed
1 of 2 tasks

Fix lazy loading in Tab component #1827

ESadouski opened this issue Jul 17, 2019 · 4 comments · Fixed by #2827

Comments

@ESadouski
Copy link
Contributor

Issue type

I'm submitting a ... (check one with "x")

  • bug report
  • feature request

Issue description

Current behavior:
Lazy loading doesn't work. Content loaded even if it's not active

Expected behavior:
When tab marked as lazy-loaded it should be initialized only when its active

Steps to reproduce:
Mark tab as lazy=true

Related code:

  @Input()
  set lazyLoad(val: boolean) {
    this.init = convertToBoolProperty(val);
  }

Other information:

npm, node, OS, Browser

<!--
Node, npm: `node --version` and `npm --version`
OS: Windows (7/8/10). Linux (incl. distribution). macOS (El Capitan? Sierra?)
Browser: Chrome/Safari/Firefox/etc?
-->

Angular, Nebular

<!--
Check your `package-lock.json` or locate a `package.json` in the `node_modules` folder.
-->
@ESadouski
Copy link
Contributor Author

For those who faced this problem, route-tabset can be used as a temporary solution. Or please read angular/angular#13921 (comment)

@maihannijat
Copy link
Contributor

Duplicate of #1820

@redriverit
Copy link

Any Update on this? I am seeing all content within my tabs load instantly and not when the tab is active. As mentioned above [lazyLoad] does not change the functionality:
<nb-tab tabTitle="Parties" [lazyLoad]="false">

@dmk1111
Copy link

dmk1111 commented Dec 9, 2020

Hi, guys! Any update on this? For now, with [lazyLoad]="false" content is not rendered in the template but all hooks (calls to backend, etc) in child components are still executed. Is there a way to restrict this completely until tab is selected first time? This is pretty annoying in case we have a lot of tabs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants