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

Autoscroll with lazyloading #457

Closed
Wheelskad opened this issue Jun 19, 2015 · 1 comment
Closed

Autoscroll with lazyloading #457

Wheelskad opened this issue Jun 19, 2015 · 1 comment
Labels

Comments

@Wheelskad
Copy link

Hi,

Thanks for your great control :) !

I have a problem when i enable autoscroll option and i lazy load a folder with no children on it (my lazy function return an empty array : []). The problem seems to be in "nodeSetExpanded" function and more precisely in this code block:

dfd.done(function(){
if( flag && opts.autoScroll && !noAnimation ) {
// Scroll down to last child, but keep current node visible
node.getLastChild().scrollIntoView(true, {topNode: node}).always(function(){
if( !noEvents ) {
ctx.tree._triggerNodeEvent(flag ? "expand" : "collapse", ctx);
}
});
} else {
if( !noEvents ) {
ctx.tree._triggerNodeEvent(flag ? "expand" : "collapse", ctx);
}
}
});

node.getLastChild() is returning null so node.getLastChild().scrollIntoView throw an exception.
Do i make a mistake or is it a bug :@ ?

Thanks in advance!

@mar10 mar10 added the bug label Jun 20, 2015
@mar10
Copy link
Owner

mar10 commented Jun 20, 2015

You found a bug. I will fixt that, thanks.

But it may provide better usability if you are hiding the expander Icon (i.e. not set lazy to true) for nodes that do not have lazy children.

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

No branches or pull requests

2 participants