Skip to content

Commit 5687f96

Browse files
authored
List: loadIndicator should not be shown after dataSource option change (T1249958)
1 parent 82a6b5b commit 5687f96

File tree

2 files changed

+34
-1
lines changed

2 files changed

+34
-1
lines changed

packages/devextreme/js/__internal/ui/list/m_list.base.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -938,6 +938,7 @@ export const ListBase = CollectionWidget.inherit({
938938
case 'dataSource':
939939
this.callBase(args);
940940
this._initScrollView();
941+
this._updateLoadingState(true);
941942
this._isDataSourceFirstLoadCompleted(false);
942943
break;
943944
case 'items':

packages/devextreme/testing/tests/DevExpress.ui.widgets/listParts/commonTests.js

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,24 @@ const ScrollViewMock = DOMComponent.inherit({
144144

145145
_useTemplates() {
146146
return false;
147-
}
147+
},
148+
149+
_createActions() {
150+
this._tryRefreshPocketState();
151+
},
152+
153+
_tryRefreshPocketState() {
154+
this._pageLoading = !!this.option('onReachBottom');
155+
},
156+
157+
_optionChanged(args) {
158+
switch(args.name) {
159+
case 'onPullDown':
160+
case 'onReachBottom':
161+
this._createActions();
162+
break;
163+
}
164+
},
148165
});
149166

150167
const showListSlideMenu = ($list) => {
@@ -1139,6 +1156,21 @@ QUnit.module('options changed', moduleSetup, () => {
11391156
assert.equal($list.find('.dx-empty-message').length, 0, 'empty message was not rendered');
11401157
});
11411158

1159+
QUnit.test('LoadIndicator should not be shown on dataSource runtime change with repaintChangesOnly=true (T1249958)', function(assert) {
1160+
const $list = $('#list').dxList({
1161+
dataSource: ['one', 'two', 'tree'],
1162+
repaintChangesOnly: true,
1163+
useNativeScrolling: true,
1164+
});
1165+
const instance = $list.dxList('instance');
1166+
const scrollView = $list.dxScrollView('instance');
1167+
1168+
instance.option('dataSource', ['four', 'five', 'six']);
1169+
1170+
assert.strictEqual(scrollView._pageLoading, false, 'scrollBottom div is hidden');
1171+
});
1172+
1173+
11421174
QUnit.test('list should be able to change grouped option to false after dataSource option', function(assert) {
11431175
const $element = $('#list').dxList({
11441176
dataSource: [{ key: 'parent', items: [{ text: 'child' }] }],

0 commit comments

Comments
 (0)