File tree Expand file tree Collapse file tree 2 files changed +17
-15
lines changed Expand file tree Collapse file tree 2 files changed +17
-15
lines changed Original file line number Diff line number Diff line change @@ -111,7 +111,9 @@ angular.module('ui.scroll', [])
111
111
// need to postpone min/maxIndexUser processing if the view is empty
112
112
if ( datasource . hasOwnProperty ( propName ) && ! buffer . length ) {
113
113
getter = datasource [ propName ] ;
114
- onRenderHandlers . push ( ( ) => datasource [ propName ] = getter ) ;
114
+ if ( Number . isInteger ( getter ) ) {
115
+ onRenderHandlers . push ( ( ) => datasource [ propName ] = getter ) ;
116
+ }
115
117
}
116
118
}
117
119
Original file line number Diff line number Diff line change @@ -110,20 +110,20 @@ describe('uiScroll user min/max indicies.', () => {
110
110
) ;
111
111
} ) ;
112
112
113
- // it('should persist user minIndex after reload', () => {
114
- // inject(function(myInfiniteDatasource) {
115
- // myInfiniteDatasource.minIndex = userMinIndex;
116
- // });
117
- // runTest(scrollSettings,
118
- // (viewport, scope) => {
119
- // scope.adapter.reload();
120
- // const topPaddingElement = angular.element(viewport.children()[0]);
121
- // const virtualItemsAmount = (-1) * userMinIndex - bufferSize + 1;
122
- // expect(topPaddingElement.height()).toBe(itemHeight * virtualItemsAmount);
123
- // expect(viewport.scrollTop()).toBe(itemHeight * ((-1) * userMinIndex + 1));
124
- // }
125
- // );
126
- // });
113
+ it ( 'should persist user minIndex after reload' , ( ) => {
114
+ inject ( function ( myInfiniteDatasource ) {
115
+ myInfiniteDatasource . minIndex = userMinIndex ;
116
+ } ) ;
117
+ runTest ( scrollSettings ,
118
+ ( viewport , scope ) => {
119
+ scope . adapter . reload ( ) ;
120
+ const topPaddingElement = angular . element ( viewport . children ( ) [ 0 ] ) ;
121
+ const virtualItemsAmount = ( - 1 ) * userMinIndex - bufferSize + 1 ;
122
+ expect ( topPaddingElement . height ( ) ) . toBe ( itemHeight * virtualItemsAmount ) ;
123
+ expect ( viewport . scrollTop ( ) ) . toBe ( itemHeight * ( ( - 1 ) * userMinIndex + 1 ) ) ;
124
+ }
125
+ ) ;
126
+ } ) ;
127
127
128
128
} ) ;
129
129
You can’t perform that action at this time.
0 commit comments