From 56613cb8a3a81ae0524cd77204d2e8bc0d0a3cc7 Mon Sep 17 00:00:00 2001 From: ksercs Date: Mon, 23 Dec 2024 21:29:00 +0400 Subject: [PATCH] small refactoring --- .../js/__internal/ui/drop_down_editor/m_drop_down_list.ts | 3 +-- packages/devextreme/js/__internal/ui/m_drop_down_box.ts | 6 +++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/packages/devextreme/js/__internal/ui/drop_down_editor/m_drop_down_list.ts b/packages/devextreme/js/__internal/ui/drop_down_editor/m_drop_down_list.ts index af3c29de9c09..3208623addd3 100644 --- a/packages/devextreme/js/__internal/ui/drop_down_editor/m_drop_down_list.ts +++ b/packages/devextreme/js/__internal/ui/drop_down_editor/m_drop_down_list.ts @@ -272,11 +272,10 @@ const DropDownList = DropDownEditor.inherit({ return this.callBase(currentValue); } - const that = this; return this ._loadInputValue( currentValue, - (...args) => { that._setSelectedItem(...args); }, + (...args) => { this._setSelectedItem(...args); }, ) .always(this.callBase.bind(this, currentValue)); }, diff --git a/packages/devextreme/js/__internal/ui/m_drop_down_box.ts b/packages/devextreme/js/__internal/ui/m_drop_down_box.ts index dae315019fa3..3016b80a9af4 100644 --- a/packages/devextreme/js/__internal/ui/m_drop_down_box.ts +++ b/packages/devextreme/js/__internal/ui/m_drop_down_box.ts @@ -101,12 +101,12 @@ const DropDownBox = (DropDownEditor as any).inherit({ return sortedValues.map((x) => x.itemDisplayValue); }, - _renderInputValue(arg = {}) { + _renderInputValue({ renderOnly }: { renderOnly?: boolean } = {}) { this._rejectValueLoading(); const values = []; if (!this._dataSource) { - this.callBase({ ...arg, value: values }); + this.callBase({ renderOnly, value: values }); return Deferred().resolve(); } @@ -139,7 +139,7 @@ const DropDownBox = (DropDownEditor as any).inherit({ const orderedValues = this._sortValuesByKeysOrder(keys, values); this.option('displayValue', orderedValues); callBase({ - ...arg, + renderOnly, value: values.length && orderedValues, }); });