From 47265519b01630fb81ef849eed6f8edf04734bc0 Mon Sep 17 00:00:00 2001 From: Mark Allen Ramirez Date: Mon, 9 Dec 2024 14:18:10 +0800 Subject: [PATCH] fix --- .../js/ui/shared/ui.editor_factory_mixin.js | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/packages/devextreme/js/ui/shared/ui.editor_factory_mixin.js b/packages/devextreme/js/ui/shared/ui.editor_factory_mixin.js index ee54a4e11b5..a7841e265a4 100644 --- a/packages/devextreme/js/ui/shared/ui.editor_factory_mixin.js +++ b/packages/devextreme/js/ui/shared/ui.editor_factory_mixin.js @@ -49,18 +49,23 @@ const getTextEditorConfig = function(options) { onValueChanged: function(e) { const needDelayedUpdate = options.parentType === 'filterRow' || options.parentType === 'searchPanel'; - const notChangedProgrammatically = isDefined(e.event); + const isInputOrKeyUpEvent = e.event && (e.event.type === 'input' || e.event.type === 'keyup'); const updateValue = function(newValue, notFireEvent) { options && options.setValue(newValue, notFireEvent); }; clearTimeout(data.valueChangeTimeout); - if(notChangedProgrammatically && needDelayedUpdate) { - sharedData.valueChangeTimeout = data.valueChangeTimeout = setTimeout(function() { - const value = e.value === '' ? null : e.value; - updateValue(value, data.valueChangeTimeout !== sharedData.valueChangeTimeout); - }, isDefined(options.updateValueTimeout) ? options.updateValueTimeout : 0); + if(isDefined(e.event)) { + const newValue = e.value === '' ? null : e.value; + + if(isInputOrKeyUpEvent && needDelayedUpdate) { + sharedData.valueChangeTimeout = data.valueChangeTimeout = setTimeout(function() { + updateValue(newValue, data.valueChangeTimeout !== sharedData.valueChangeTimeout); + }, isDefined(options.updateValueTimeout) ? options.updateValueTimeout : 0); + } else { + updateValue(newValue); + } } else { updateValue(e.value); }