animated scrolling could leave cursor off screen
This commit is contained in:
parent
156d7c5c8f
commit
1def900834
1 changed files with 8 additions and 6 deletions
|
|
@ -1068,7 +1068,7 @@ var VirtualRenderer = function(container, theme) {
|
||||||
var _self = this;
|
var _self = this;
|
||||||
var steps = _self.$calcSteps(fromValue, toValue);
|
var steps = _self.$calcSteps(fromValue, toValue);
|
||||||
this.$inScrollAnimation = true;
|
this.$inScrollAnimation = true;
|
||||||
|
|
||||||
clearInterval(this.$timer);
|
clearInterval(this.$timer);
|
||||||
|
|
||||||
_self.session.setScrollTop(steps.shift());
|
_self.session.setScrollTop(steps.shift());
|
||||||
|
|
@ -1077,18 +1077,20 @@ var VirtualRenderer = function(container, theme) {
|
||||||
_self.session.setScrollTop(steps.shift());
|
_self.session.setScrollTop(steps.shift());
|
||||||
// trick session to think it's already scrolled to not loose toValue
|
// trick session to think it's already scrolled to not loose toValue
|
||||||
_self.session.$scrollTop = toValue;
|
_self.session.$scrollTop = toValue;
|
||||||
} else {
|
} else if (toValue != null) {
|
||||||
_self.$inScrollAnimation = false;
|
|
||||||
clearInterval(_self.$timer);
|
|
||||||
|
|
||||||
_self.session.$scrollTop = -1;
|
_self.session.$scrollTop = -1;
|
||||||
_self.session.setScrollTop(toValue);
|
_self.session.setScrollTop(toValue);
|
||||||
|
toValue = null;
|
||||||
|
} else {
|
||||||
|
// do this on separate step to not get spurious scroll event from scrollbar
|
||||||
|
_self.$timer = clearInterval(_self.$timer);
|
||||||
|
_self.$inScrollAnimation = false;
|
||||||
callback && callback();
|
callback && callback();
|
||||||
}
|
}
|
||||||
}, 10);
|
}, 10);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* VirtualRenderer.scrollToY(scrollTop) -> Number
|
* VirtualRenderer.scrollToY(scrollTop) -> Number
|
||||||
* - scrollTop (Number): The position to scroll to
|
* - scrollTop (Number): The position to scroll to
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue