fix scroll-end events not triggered

... when dragging the scrollbar to the end with the mouse.
This commit is contained in:
Axel Bocciarelli
2015-11-19 11:05:57 +11:00
parent e1910cde3e
commit 24b34d3dea

View File

@@ -56,13 +56,13 @@ module.exports = function (element, axis, value) {
var i = instances.get(element);
if (axis === 'top' && value > i.contentHeight - i.containerHeight) {
if (axis === 'top' && value >= i.contentHeight - i.containerHeight) {
element.scrollTop = i.contentHeight - i.containerHeight;
element.dispatchEvent(yEndEvent);
return; // don't allow scroll past container
}
if (axis === 'left' && value > i.contentWidth - i.containerWidth) {
if (axis === 'left' && value >= i.contentWidth - i.containerWidth) {
element.scrollLeft = i.contentWidth - i.containerWidth;
element.dispatchEvent(xEndEvent);
return; // don't allow scroll past container