Skip to content

Commit 447c49a

Browse files
committed
set min/max indicies after reload
1 parent dcb900c commit 447c49a

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/ui-scroll.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ angular.module('ui.scroll', [])
7878
const bufferSize = Math.max(BUFFER_MIN, parseNumericAttr($attr.bufferSize, BUFFER_DEFAULT));
7979
const padding = Math.max(PADDING_MIN, parseNumericAttr($attr.padding, PADDING_DEFAULT));
8080
let startIndex = parseNumericAttr($attr.startIndex, 1);
81-
let ridActual = 0;// current data revision id
81+
let ridActual = 0; // current data revision id
8282
let pending = [];
8383

8484
const elementRoutines = new ElementRoutines($injector, $q);
@@ -109,7 +109,7 @@ angular.module('ui.scroll', [])
109109
function persistDatasourceIndex(datasource, propName) {
110110
let getter;
111111
// need to postpone min/maxIndexUser processing if the view is empty
112-
if(datasource.hasOwnProperty(propName) && !buffer.length) {
112+
if(Number.isInteger(datasource[propName])) {
113113
getter = datasource[propName];
114114
if(Number.isInteger(getter)) {
115115
onRenderHandlers.push(() => datasource[propName] = getter);
@@ -127,6 +127,10 @@ angular.module('ui.scroll', [])
127127
Object.defineProperty(datasource, propName, {
128128
set: (value) => {
129129
getter = value;
130+
if(pending.length && !buffer.length) {
131+
persistDatasourceIndex(datasource, propName);
132+
return;
133+
}
130134
buffer[propUserName] = value;
131135
const topPaddingHeightOld = viewport.topDataPos();
132136
viewport.adjustPaddings();

0 commit comments

Comments
 (0)