Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions lib/angular-smooth-scroll.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,11 @@
} while (element);
}
location = Math.max(location - offset, 0);
/*
* If element location is at the bottom and withing the last window height, then we have to set end location to the highest possible and valid scroll position.
* This fixes the problem that animated scrolls are abruptedly stopped because the location was higher than the latest possible scroll location.
*/
location = Math.min(location, document.body.scrollHeight - window.innerHeight);
return location;
};

Expand Down