@syncfusion/ej2-dropdowns 33.2.6 → 33.2.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3033,7 +3033,8 @@ let DropDownBase = class DropDownBase extends Component {
3033
3033
  }
3034
3034
  else {
3035
3035
  for (const item of this.listData) {
3036
- if (!isNullOrUndefined(item) && getValue((this.fields.value ? this.fields.value : 'value'), item) === value) {
3036
+ if (!isNullOrUndefined(item) && (getValue((this.fields.value ? this.fields.value : 'value'), item) === value
3037
+ || this.getModuleName() === 'multiselect' && this.isVirtualizationEnabled && this.properties.allowCustomValue && getValue((this.fields.value ? this.fields.value : 'value'), item) === value.toString())) {
3037
3038
  return item;
3038
3039
  }
3039
3040
  }
@@ -8107,6 +8108,7 @@ let DropDownTree = class DropDownTree extends Component {
8107
8108
  // Specifies if the checkAll method has been called
8108
8109
  this.isCheckAllCalled = false;
8109
8110
  this.isFromFilterChange = false;
8111
+ this.fallbackValue = [];
8110
8112
  }
8111
8113
  /**
8112
8114
  * Get the properties to be maintained in the persisted state.
@@ -9342,6 +9344,10 @@ let DropDownTree = class DropDownTree extends Component {
9342
9344
  }
9343
9345
  setTreeValue() {
9344
9346
  if (this.value !== null && this.value.length !== 0) {
9347
+ const dataReady = this.treeItems && this.treeItems.length > 0;
9348
+ if (!dataReady && this.fallbackValue.length === 0) {
9349
+ this.fallbackValue = this.value.slice();
9350
+ }
9345
9351
  let data;
9346
9352
  if (this.showCheckBox || this.allowMultiSelection) {
9347
9353
  for (let i = this.value.length - 1; i >= 0; i--) {
@@ -11001,6 +11007,13 @@ let DropDownTree = class DropDownTree extends Component {
11001
11007
  break;
11002
11008
  case 'fields':
11003
11009
  this.setFields();
11010
+ setTimeout(() => {
11011
+ if (this.value.length === 0 && this.fallbackValue.length > 0) {
11012
+ this.value = this.fallbackValue;
11013
+ this.updateValue(this.fallbackValue);
11014
+ this.fallbackValue = [];
11015
+ }
11016
+ }, 1);
11004
11017
  break;
11005
11018
  case 'readonly':
11006
11019
  Input.setReadonly(newProp.readonly, this.inputEle);
@@ -13931,7 +13944,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
13931
13944
  else {
13932
13945
  this.updateActionList(ulElement, list, e);
13933
13946
  }
13934
- if (this.dataSource instanceof DataManager && this.allowCustomValue && !this.isCustomRendered &&
13947
+ if (this.dataSource instanceof DataManager && this.allowCustomValue && (!this.isCustomRendered || this.enableVirtualization) &&
13935
13948
  this.inputElement.value && this.inputElement.value !== '') {
13936
13949
  let query = new Query();
13937
13950
  query = this.allowFiltering ? query.where(this.fields.text, 'startswith', this.inputElement.value, this.ignoreCase, this.ignoreAccent) : query;
@@ -14455,7 +14468,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
14455
14468
  if (this.enableVirtualization) {
14456
14469
  this.virtualCustomData = dataItem;
14457
14470
  const tempData = this.dataSource instanceof DataManager ?
14458
- JSON.parse(JSON.stringify(this.listData)) : JSON.parse(JSON.stringify(this.dataSource));
14471
+ JSON.parse(JSON.stringify(this.mainData)) : JSON.parse(JSON.stringify(this.dataSource));
14459
14472
  let totalData = [];
14460
14473
  if (this.virtualCustomSelectData && this.virtualCustomSelectData.length > 0) {
14461
14474
  totalData = tempData.concat(this.virtualCustomSelectData);
@@ -17353,7 +17366,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
17353
17366
  this.allowCustomValue &&
17354
17367
  ((!(this.dataSource instanceof DataManager)) ||
17355
17368
  (this.dataSource instanceof DataManager && isInitialVirtualData)))) {
17356
- const indexItem = this.listData.length;
17369
+ const indexItem = this.dataSource instanceof DataManager ? this.totalItemCount : this.listData.length;
17357
17370
  let newValue = {};
17358
17371
  setValue(this.fields.text, value, newValue);
17359
17372
  setValue(this.fields.value, value, newValue);
@@ -19816,6 +19829,10 @@ let MultiSelect = class MultiSelect extends DropDownBase {
19816
19829
  }, 100);
19817
19830
  this.initStatus = true;
19818
19831
  }
19832
+ else {
19833
+ this.initialValueUpdate(this.value, true, isInitialRender);
19834
+ this.initialUpdate();
19835
+ }
19819
19836
  });
19820
19837
  }
19821
19838
  else {