Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions packages/devextreme/js/__internal/ui/m_lookup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -811,6 +811,20 @@ const Lookup = DropDownList.inherit({
}
},

_filterDataSource(...args) {
if (this._list && !this._list._dataSource && this._isMinSearchLengthExceeded()) {
this._list?._scrollView.startLoading();
}

this.callBase(...args);
},

_dataSourceFiltered(...args) {
this.callBase(...args);

this._list?._scrollView.finishLoading();
},

_updateActiveDescendant() {
this.callBase();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3399,6 +3399,45 @@ QUnit.module('dataSource integration', {

assert.ok($loadPanel.is(':visible'), 'load panel is visible');
});

QUnit.test('load panel should be displayed if search value length exceed minSearchLength and showDataBeforeSearch=false, (T1215813)', function(assert) {
const loadDelay = 1000;
const timeoutDelay = 100;
const instance = this.$element.dxLookup({
dataSource: {
load: () => {
const d = new $.Deferred();

setTimeout(() => {
d.resolve([]);
}, loadDelay);

return d;
}
},
searchEnabled: true,
showDataBeforeSearch: false,
minSearchLength: 3,
searchTimeout: timeoutDelay,
useNativeScrolling: false,
opened: true
}).dxLookup('instance');

const $content = $(instance.content());
const $input = $content.find(`.${LOOKUP_SEARCH_CLASS} .${TEXTEDITOR_INPUT_CLASS}`);
const $loadPanel = $content.find(`.${SCROLL_VIEW_LOAD_PANEL_CLASS}`);
const keyboard = keyboardMock($input);

keyboard.type('abc');
this.clock.tick(timeoutDelay + loadDelay / 2);
assert.ok($loadPanel.is(':visible'), 'load panel is visible');
this.clock.tick(loadDelay / 2);
assert.ok($loadPanel.is(':hidden'), 'load panel is not visible when loading has been finished');

keyboard.press('backspace');
this.clock.tick(loadDelay / 2);
assert.ok($loadPanel.is(':hidden'), 'load panel is not visible if value length less than minSearchLength)');
});
});


Expand Down
Loading