Ignore negative page scroll values on iOS

Bug: T323400
Change-Id: Id37f3da183a08f936c6b6d11ed7307bb9d8bd28b
This commit is contained in:
Ed Sanders 2022-11-29 14:29:50 +00:00
parent 76199b7439
commit 79537c9892

View file

@ -98,7 +98,8 @@ function init( $container ) {
var $body = $( document.body );
// TODO: Use ve.addPassiveEventListener
$scrollListener.on( 'scroll', OO.ui.throttle( function () {
var scrollTop = $scrollContainer.scrollTop();
// Round negative values up to 0 to ignore iOS scroll bouncing (T323400)
var scrollTop = Math.max( $scrollContainer.scrollTop(), 0 );
var isScrollDown = scrollTop > lastScrollTop;
if ( isScrollDown !== wasScrollDown ) {
if ( !isScrollDown ) {