diff --git a/src/dropdownListModel.ts b/src/dropdownListModel.ts index 59ad17790c..c87f523bb2 100644 --- a/src/dropdownListModel.ts +++ b/src/dropdownListModel.ts @@ -81,14 +81,14 @@ export class DropdownListModel extends Base { const isUpdate = (this.itemsSettings.skip + 1) < this.itemsSettings.totalCount; if (!this.itemsSettings.skip || isUpdate) { - if (!!this.filterString && settings.debouncedInputValue > 0) { + if (!!this.filterString && settings.dropdownSearchDelay > 0) { if (!!this.timer) { clearTimeout(this.timer); this.timer = undefined; } this.timer = setTimeout(() => { this.loadQuestionChoices(callbackAfterItemsLoaded); - }, settings.debouncedInputValue); + }, settings.dropdownSearchDelay); } else { this.loadQuestionChoices(callbackAfterItemsLoaded); } diff --git a/src/settings.ts b/src/settings.ts index e3712fa79d..462761f675 100644 --- a/src/settings.ts +++ b/src/settings.ts @@ -434,7 +434,7 @@ export var settings = { * This setting applies to all TagBox questions on a page. You can use the [closeOnSelect](https://surveyjs.io/form-library/documentation/api-reference/dropdown-tag-box-model#closeOnSelect) property to specify the same setting for an individual TagBox question. */ tagboxCloseOnSelect: false, - debouncedInputValue: 0, + dropdownSearchDelay: 500, /** * A function that activates a browser confirm dialog. * diff --git a/tests/entries/test.ts b/tests/entries/test.ts index cb89cb791b..7041fba98b 100644 --- a/tests/entries/test.ts +++ b/tests/entries/test.ts @@ -86,4 +86,4 @@ import "../../src/localization/german"; import { settings } from "../../src/settings"; settings.animationEnabled = false; - +settings.dropdownSearchDelay = 0; diff --git a/tests/questionDropdownTests.ts b/tests/questionDropdownTests.ts index e695958e21..6a6f46782a 100644 --- a/tests/questionDropdownTests.ts +++ b/tests/questionDropdownTests.ts @@ -820,10 +820,10 @@ QUnit.test("lazy loading: several loading", assert => { }, onChoicesLazyLoadCallbackTimeOut + callbackTimeOutDelta); }); -QUnit.test("lazy loading + change filter string + debouncedInputValue", assert => { +QUnit.test("lazy loading + change filter string + dropdownSearchDelay ", assert => { const newValueDebouncedInputValue = 2 * onChoicesLazyLoadCallbackTimeOut; - const oldValueDebouncedInputValue = settings.debouncedInputValue; - settings.debouncedInputValue = newValueDebouncedInputValue; + const oldValueDebouncedInputValue = settings.dropdownSearchDelay; + settings.dropdownSearchDelay = newValueDebouncedInputValue; const done1 = assert.async(); const done2 = assert.async(); const done3 = assert.async(); @@ -864,7 +864,7 @@ QUnit.test("lazy loading + change filter string + debouncedInputValue", assert = assert.equal(question.choices.length, 25, "filter is 22 after request"); assert.equal(question.choices[0].value, 22, "filter is 22 after request"); - settings.debouncedInputValue = oldValueDebouncedInputValue; + settings.dropdownSearchDelay = oldValueDebouncedInputValue; done4(); }, onChoicesLazyLoadCallbackTimeOut + newValueDebouncedInputValue); done3(); diff --git a/tests/question_tagbox_tests.ts b/tests/question_tagbox_tests.ts index bc0f07c171..5690b05df3 100644 --- a/tests/question_tagbox_tests.ts +++ b/tests/question_tagbox_tests.ts @@ -384,10 +384,10 @@ QUnit.test("lazy loading: several loading", assert => { }, onChoicesLazyLoadCallbackTimeOut + callbackTimeOutDelta); }); -QUnit.test("lazy loading + change filter string + debouncedInputValue", assert => { +QUnit.test("lazy loading + change filter string + dropdownSearchDelay ", assert => { const newValueDebouncedInputValue = 2 * onChoicesLazyLoadCallbackTimeOut; - const oldValueDebouncedInputValue = settings.debouncedInputValue; - settings.debouncedInputValue = newValueDebouncedInputValue; + const oldValueDebouncedInputValue = settings.dropdownSearchDelay; + settings.dropdownSearchDelay = newValueDebouncedInputValue; const done1 = assert.async(); const done2 = assert.async(); const done3 = assert.async(); @@ -428,7 +428,7 @@ QUnit.test("lazy loading + change filter string + debouncedInputValue", assert = assert.equal(question.choices.length, 25, "filter is 22 after request"); assert.equal(question.choices[0].value, 22, "filter is 22 after request"); - settings.debouncedInputValue = oldValueDebouncedInputValue; + settings.dropdownSearchDelay = oldValueDebouncedInputValue; done4(); }, onChoicesLazyLoadCallbackTimeOut + newValueDebouncedInputValue); done3();