dynamic-virtual-scroller
Advanced tools
Comparing version 2.2.7 to 2.2.8
{ | ||
"name": "dynamic-virtual-scroller", | ||
"version": "2.2.7", | ||
"version": "2.2.8", | ||
"description": "A virtual scroller for the web that can handle dynamic row and column sizes.", | ||
@@ -5,0 +5,0 @@ "main": "virtual-scroller.js", |
import {ATTRIBUTES, EVENTS, CLASSES} from "./constants"; | ||
import utils from './utils'; | ||
import validateParameters from './validateParameters'; | ||
@@ -238,3 +239,3 @@ var {$, _} = window; | ||
*/ | ||
var iOSDevice = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream; | ||
var iOSDevice = utils.iOSDetection(); | ||
var scrollSpeedModifier = iOSDevice ? 1.9 : 1; | ||
@@ -241,0 +242,0 @@ |
@@ -9,2 +9,3 @@ import {ATTRIBUTES, EVENTS, CLASSES, DATA} from "./constants"; | ||
import ScrollManager from './ScrollManager'; | ||
import utils from './utils'; | ||
var {$, _} = window; | ||
@@ -524,13 +525,15 @@ var divProto = $('<div>'); | ||
// on the body to be scrolled. | ||
// Note: We don't check if the user is on an iOS device here. You can do that before calling this function but | ||
// we recommend just always calling it as it does not seem to have negative effects and you have more consistent | ||
// states of your app (which might prevent bugs from only occurring on iOS). | ||
VirtualScroller.preventBodyScrollingOnIOS = () => { | ||
$('html') | ||
.css({ | ||
width: '100%', | ||
position: 'fixed', | ||
overflow: 'hidden' | ||
}) | ||
.attr('inline-styles-were-set-by', 'VirtualScroller.preventBodyScrollingOnIOS'); | ||
// We only run this on iOS because Firefox won't render a background image if position of <html> is fixed | ||
if (utils.iOSDetection() === false) { | ||
return; | ||
} | ||
// Use html instead of body because it will also stop background images from scrolling | ||
$('html') | ||
.css({ | ||
width: '100%', | ||
position: 'fixed', | ||
overflow: 'hidden' | ||
}) | ||
.attr('inline-styles-were-set-by', 'VirtualScroller.preventBodyScrollingOnIOS'); | ||
}; | ||
@@ -537,0 +540,0 @@ |
Sorry, the diff of this file is too big to display
486236
27
6476