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

Repaint when tree is hidden #177

Open
FedericoGarciaGarcia opened this issue Mar 1, 2024 · 0 comments
Open

Repaint when tree is hidden #177

FedericoGarciaGarcia opened this issue Mar 1, 2024 · 0 comments

Comments

@FedericoGarciaGarcia
Copy link

FedericoGarciaGarcia commented Mar 1, 2024

I have two tabs (using Bootstrap). One renders a table, and the other renders a tree with Treant.js. Because the tree tab is initially not active, I need to call chart.tree.reload() when the tab becomes visible:

$(document).on('shown.bs.tab', '#tab-id', () => {
  chart.tree.reload();
});

The problem is that the browser window scrolls all the way to the top when the tree reloads, because for a brief moment the tab container goes from having the height of the table to having no height.

Is there a way to reload the tree offscreen in order to prevent this issue from happening? Maybe passing a width to the tree config since I know the sizes beforehand?

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

No branches or pull requests

1 participant