Skip to content

Commit 6fa6bef

Browse files
authored
List: loadIndicator should not be shown after dataSource option change (T1249958)
1 parent 1cac978 commit 6fa6bef

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
@@ -1089,6 +1089,7 @@ export const ListBase = CollectionWidget.inherit({
10891089
case 'dataSource':
10901090
this.callBase(args);
10911091
this._initScrollView();
1092+
this._updateLoadingState(true);
10921093
this._isDataSourceFirstLoadCompleted(false);
10931094
break;
10941095
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
@@ -145,7 +145,24 @@ const ScrollViewMock = DOMComponent.inherit({
145145

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

151168
const showListSlideMenu = ($list) => {
@@ -1176,6 +1193,21 @@ QUnit.module('options changed', moduleSetup, () => {
11761193
assert.equal($list.find('.dx-empty-message').length, 0, 'empty message was not rendered');
11771194
});
11781195

1196+
QUnit.test('LoadIndicator should not be shown on dataSource runtime change with repaintChangesOnly=true (T1249958)', function(assert) {
1197+
const $list = $('#list').dxList({
1198+
dataSource: ['one', 'two', 'tree'],
1199+
repaintChangesOnly: true,
1200+
useNativeScrolling: true,
1201+
});
1202+
const instance = $list.dxList('instance');
1203+
const scrollView = $list.dxScrollView('instance');
1204+
1205+
instance.option('dataSource', ['four', 'five', 'six']);
1206+
1207+
assert.strictEqual(scrollView._pageLoading, false, 'scrollBottom div is hidden');
1208+
});
1209+
1210+
11791211
QUnit.test('list should be able to change grouped option to false after dataSource option', function(assert) {
11801212
const $element = $('#list').dxList({
11811213
dataSource: [{ key: 'parent', items: [{ text: 'child' }] }],

0 commit comments

Comments
 (0)