qnipp / meteor-treeview

This is a Blaze template to be used to display a tree (using jsTree) right from a collection.
MIT License
9 stars 8 forks source link

State lost when redrawn? #8

Closed FrancisBou closed 7 years ago

FrancisBou commented 7 years ago

I am experiecing an issue where the whole state of the tree is lost after redrawn, and so any changes a user make can trigger this bug.

fknipp commented 7 years ago

Do you use the state plugin?

If not: Does this plugin help?

If yes: Does this bug occur on http://treeview.meteor.qnipp.com/? Could you please provide me step-by-step instructions to reconstruct the issue?

FrancisBou commented 7 years ago

@fknipp Yes I use the state plugin, unfortunalety I can't reproduce the bug on the demo page. I will look more deeply into it a make a pull request if it comes from the plugin. From what I can tell, the state cannot be fully restored in jsTree internal method "_load_nodes", just after jsTree.refresh is called. This is because "this.is_loading(nodes[i])" returns true so it simply exits there.

fknipp commented 7 years ago

I've never dug so deep into jsTree internals. Maybe, the problem is solved in a newer jsTree version.

FrancisBou commented 7 years ago

I think I figured it out now, the problem seems to be the "select" argument, Sometimes it caused the state to be internally reset with just this folder selected, and the refresh action closed all other folders. Now I just set it to null and do not have this problem again. Btw thanks so much for this plugin!

fknipp commented 7 years ago

You're welcome. Thanks for closing the issue.