@@ -141,20 +141,22 @@ export class IgxScrollInertiaDirective implements OnInit, OnDestroy {
141141 this . _scrollToY (
142142 this . _startY + scrollDeltaY * scrollStep
143143 ) ;
144- this . preventParentScroll ( evt ) ;
144+ this . preventParentScroll ( evt , true ) ;
145145 }
146146 }
147147
148148 /**
149149 * @hidden
150150 * When there is still room to scroll up/down prevent the parent elements from scrolling too.
151151 */
152- protected preventParentScroll ( evt ) {
152+ protected preventParentScroll ( evt , preventDefault ) {
153153 const curScrollTop = this . IgxScrollInertiaScrollContainer . scrollTop ;
154154 const maxScrollTop = this . IgxScrollInertiaScrollContainer . children [ 0 ] . scrollHeight -
155155 this . IgxScrollInertiaScrollContainer . offsetHeight ;
156156 if ( 0 < curScrollTop && curScrollTop < maxScrollTop ) {
157- evt . preventDefault ( ) ;
157+ if ( preventDefault ) {
158+ evt . preventDefault ( ) ;
159+ }
158160 if ( evt . stopPropagation ) {
159161 evt . stopPropagation ( ) ;
160162 }
@@ -195,7 +197,7 @@ export class IgxScrollInertiaDirective implements OnInit, OnDestroy {
195197
196198 this . _touchPrevented = false ;
197199 if ( this . IgxScrollInertiaDirection === 'vertical' ) {
198- this . preventParentScroll ( event ) ;
200+ this . preventParentScroll ( event , false ) ;
199201 }
200202 }
201203
@@ -273,7 +275,7 @@ export class IgxScrollInertiaDirective implements OnInit, OnDestroy {
273275
274276 // On Safari preventing the touchmove would prevent default page scroll behaviour even if there is the element doesn't have overflow
275277 if ( this . IgxScrollInertiaDirection === 'vertical' ) {
276- this . preventParentScroll ( event ) ;
278+ this . preventParentScroll ( event , true ) ;
277279 }
278280 }
279281
@@ -298,7 +300,7 @@ export class IgxScrollInertiaDirective implements OnInit, OnDestroy {
298300 this . _inertiaInit ( speedX , speedY ) ;
299301 }
300302 if ( this . IgxScrollInertiaDirection === 'vertical' ) {
301- this . preventParentScroll ( event ) ;
303+ this . preventParentScroll ( event , false ) ;
302304 }
303305 }
304306
0 commit comments