Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
markallenramirez committed Dec 9, 2024
1 parent 28b89a6 commit 4726551
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions packages/devextreme/js/ui/shared/ui.editor_factory_mixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 4726551

Please sign in to comment.