@syncfusion/ej2-dropdowns 35.1.43 → 35.2.12

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.
@@ -46,6 +46,7 @@ var CHIP_CLOSE = 'e-chips-close';
46
46
  var CHIP_SELECTED = 'e-chip-selected';
47
47
  var SEARCHBOX_WRAPPER = 'e-searcher';
48
48
  var DELIMITER_VIEW_WRAPPER = 'e-delimiter';
49
+ var NULL_CHIP = 'e-chip-null';
49
50
  var ZERO_SIZE = 'e-zero-size';
50
51
  var REMAIN_WRAPPER = 'e-remain';
51
52
  var CLOSEICON_CLASS = 'e-chips-close e-close-hooker';
@@ -510,16 +511,24 @@ var MultiSelect = /** @class */ (function (_super) {
510
511
  return;
511
512
  }
512
513
  var elements = this.chipCollectionWrapper.querySelectorAll('span.' + CHIP);
513
- var value = elements[elements.length - 1].getAttribute('data-value');
514
+ var lastElement = elements[elements.length - 1];
515
+ var isNullChip = lastElement.classList.contains(NULL_CHIP);
516
+ var customValue = null;
514
517
  if (!isNullOrUndefined(this.value)) {
515
518
  this.tempValues = this.allowObjectBinding ? this.value.slice() : this.value.slice();
516
519
  }
517
- var customValue = this.allowObjectBinding ? this.enableVirtualization ?
518
- this.getVirtualDataByValue(this.getFormattedValue(value)) :
519
- this.getDataByValue(this.getFormattedValue(value)) : this.getFormattedValue(value);
520
- if (this.allowCustomValue && (value !== 'false' && customValue === false || (!isNullOrUndefined(customValue) &&
521
- customValue.toString() === 'NaN'))) {
522
- customValue = value;
520
+ if (isNullChip) {
521
+ customValue = null;
522
+ }
523
+ else {
524
+ var value = lastElement.getAttribute('data-value');
525
+ customValue = this.allowObjectBinding ? this.enableVirtualization ?
526
+ this.getVirtualDataByValue(this.getFormattedValue(value)) :
527
+ this.getDataByValue(this.getFormattedValue(value)) : this.getFormattedValue(value);
528
+ if (this.allowCustomValue && (value !== 'false' && customValue === false || (!isNullOrUndefined(customValue) &&
529
+ customValue.toString() === 'NaN'))) {
530
+ customValue = value;
531
+ }
523
532
  }
524
533
  this.removeValue(customValue, e);
525
534
  this.removeChipSelection();
@@ -860,48 +869,54 @@ var MultiSelect = /** @class */ (function (_super) {
860
869
  HIDE_LIST :
861
870
  dropDownBaseClasses.selected;
862
871
  if (!isNullOrUndefined(this.value)) {
863
- for (var index = 0; !isNullOrUndefined(this.value[index]); index++) {
864
- value = this.allowObjectBinding ? getValue((this.fields.value) ? this.fields.value : '', this.value[index]) :
865
- this.value[index];
866
- element = this.findListElement(this.list, 'li', 'data-value', value);
867
- if (element) {
868
- addClass([element], className);
869
- if (this.hideSelectedItem && element.previousSibling
870
- && element.previousElementSibling.classList.contains(dropDownBaseClasses.group)
871
- && (!element.nextElementSibling ||
872
- element.nextElementSibling.classList.contains(dropDownBaseClasses.group))) {
873
- addClass([element.previousElementSibling], className);
874
- }
875
- if (this.hideSelectedItem && this.fields.groupBy && !element.previousElementSibling.classList.contains(HIDE_LIST)) {
876
- this.hideGroupItem(value);
877
- }
878
- if (this.hideSelectedItem && element.classList.contains(dropDownBaseClasses.focus)) {
879
- removeClass([element], dropDownBaseClasses.focus);
880
- var listEle = element.parentElement.querySelectorAll('.' +
881
- dropDownBaseClasses.li + ':not(.' + HIDE_LIST + ')' + ':not(.' + DISABLED + ')');
882
- if (listEle.length > 0) {
883
- addClass([listEle[0]], dropDownBaseClasses.focus);
884
- this.updateAriaActiveDescendant();
872
+ var isOnlyNull = this.isValueOnlyNull();
873
+ if (!isOnlyNull) {
874
+ for (var index = 0; index < this.value.length; index++) {
875
+ value = this.allowObjectBinding ? getValue((this.fields.value) ? this.fields.value : '', this.value[index]) :
876
+ this.value[index];
877
+ if (isNullOrUndefined(value)) {
878
+ continue;
879
+ }
880
+ element = this.findListElement(this.list, 'li', 'data-value', value);
881
+ if (element) {
882
+ addClass([element], className);
883
+ if (this.hideSelectedItem && element.previousSibling
884
+ && element.previousElementSibling.classList.contains(dropDownBaseClasses.group)
885
+ && (!element.nextElementSibling ||
886
+ element.nextElementSibling.classList.contains(dropDownBaseClasses.group))) {
887
+ addClass([element.previousElementSibling], className);
885
888
  }
886
- else {
887
- //EJ2-57588 - for this task, we prevent the ul element cloning ( this.ulElement = this.ulElement.cloneNode ? <HTMLElement>this.ulElement.cloneNode(true) : this.ulElement;)
888
- if (!(this.list && this.list.querySelectorAll('.' + dropDownBaseClasses.li).length > 0)) {
889
- this.l10nUpdate();
890
- addClass([this.list], dropDownBaseClasses.noData);
889
+ if (this.hideSelectedItem && this.fields.groupBy && !element.previousElementSibling.classList.contains(HIDE_LIST)) {
890
+ this.hideGroupItem(value);
891
+ }
892
+ if (this.hideSelectedItem && element.classList.contains(dropDownBaseClasses.focus)) {
893
+ removeClass([element], dropDownBaseClasses.focus);
894
+ var listEle = element.parentElement.querySelectorAll('.' +
895
+ dropDownBaseClasses.li + ':not(.' + HIDE_LIST + ')' + ':not(.' + DISABLED + ')');
896
+ if (listEle.length > 0) {
897
+ addClass([listEle[0]], dropDownBaseClasses.focus);
898
+ this.updateAriaActiveDescendant();
899
+ }
900
+ else {
901
+ //EJ2-57588 - for this task, we prevent the ul element cloning ( this.ulElement = this.ulElement.cloneNode ? <HTMLElement>this.ulElement.cloneNode(true) : this.ulElement;)
902
+ if (!(this.list && this.list.querySelectorAll('.' + dropDownBaseClasses.li).length > 0)) {
903
+ this.l10nUpdate();
904
+ addClass([this.list], dropDownBaseClasses.noData);
905
+ }
891
906
  }
892
907
  }
893
- }
894
- element.setAttribute('aria-selected', 'true');
895
- if (this.mode === 'CheckBox' && element.classList.contains('e-active')) {
896
- var ariaValue = element.getElementsByClassName('e-check').length;
897
- if (ariaValue === 0) {
898
- var args = {
899
- module: 'CheckBoxSelection',
900
- enable: this.mode === 'CheckBox',
901
- li: element,
902
- e: null
903
- };
904
- this.notify('updatelist', args);
908
+ element.setAttribute('aria-selected', 'true');
909
+ if (this.mode === 'CheckBox' && element.classList.contains('e-active')) {
910
+ var ariaValue = element.getElementsByClassName('e-check').length;
911
+ if (ariaValue === 0) {
912
+ var args = {
913
+ module: 'CheckBoxSelection',
914
+ enable: this.mode === 'CheckBox',
915
+ li: element,
916
+ e: null
917
+ };
918
+ this.notify('updatelist', args);
919
+ }
905
920
  }
906
921
  }
907
922
  }
@@ -1692,13 +1707,26 @@ var MultiSelect = /** @class */ (function (_super) {
1692
1707
  var activeItem = !isNullOrUndefined(this.ulElement)
1693
1708
  ? this.ulElement.getElementsByClassName('e-item-focus')[0]
1694
1709
  : null;
1710
+ var filterInput = this.allowFiltering && !isNullOrUndefined(this.popupWrapper)
1711
+ ? this.popupWrapper.querySelector('.' + FILTERINPUT)
1712
+ : null;
1695
1713
  if (!isNullOrUndefined(activeItem) && this.isPopupOpen()) {
1696
1714
  attributes(this.inputElement, {
1697
1715
  'aria-activedescendant': activeItem.id
1698
1716
  });
1717
+ if (filterInput) {
1718
+ attributes(filterInput, {
1719
+ 'aria-activedescendant': activeItem.id
1720
+ });
1721
+ }
1699
1722
  }
1700
- else if (!isNullOrUndefined(this.inputElement)) {
1701
- this.inputElement.removeAttribute('aria-activedescendant');
1723
+ else {
1724
+ if (!isNullOrUndefined(this.inputElement)) {
1725
+ this.inputElement.removeAttribute('aria-activedescendant');
1726
+ }
1727
+ if (filterInput) {
1728
+ filterInput.removeAttribute('aria-activedescendant');
1729
+ }
1702
1730
  }
1703
1731
  };
1704
1732
  MultiSelect.prototype.pageUpSelection = function (steps, isVirtualKeyAction) {
@@ -2529,9 +2557,16 @@ var MultiSelect = /** @class */ (function (_super) {
2529
2557
  this.removeChipSelection();
2530
2558
  this.addChipSelection(temp, e);
2531
2559
  }
2532
- var currentChip = this.allowObjectBinding ?
2533
- this.getDataByValue(this.getFormattedValue(selectedElem.getAttribute('data-value'))) :
2534
- selectedElem.getAttribute('data-value');
2560
+ var isNullChip = selectedElem.classList.contains(NULL_CHIP);
2561
+ var currentChip = void 0;
2562
+ if (isNullChip) {
2563
+ currentChip = null;
2564
+ }
2565
+ else {
2566
+ currentChip = this.allowObjectBinding ?
2567
+ this.getDataByValue(this.getFormattedValue(selectedElem.getAttribute('data-value'))) :
2568
+ selectedElem.getAttribute('data-value');
2569
+ }
2535
2570
  this.removeValue(currentChip, e);
2536
2571
  this.updateDelimeter(this.delimiterChar, e);
2537
2572
  this.makeTextBoxEmpty();
@@ -2789,7 +2824,7 @@ var MultiSelect = /** @class */ (function (_super) {
2789
2824
  if (type === 'string' || type === 'number' || type === 'boolean') {
2790
2825
  for (var _i = 0, _a = this.selectedListData; _i < _a.length; _i++) {
2791
2826
  var item = _a[_i];
2792
- if (!isNullOrUndefined(item) && item === value) {
2827
+ if (item === value || (isNullOrUndefined(item) && value === null)) {
2793
2828
  return item;
2794
2829
  }
2795
2830
  }
@@ -2797,8 +2832,11 @@ var MultiSelect = /** @class */ (function (_super) {
2797
2832
  else {
2798
2833
  for (var _b = 0, _c = this.selectedListData; _b < _c.length; _b++) {
2799
2834
  var item = _c[_b];
2800
- if (!isNullOrUndefined(item) && getValue((this.fields.value ? this.fields.value : 'value'), item) === value) {
2801
- return item;
2835
+ if (item !== undefined) {
2836
+ var itemValue = getValue((this.fields.value ? this.fields.value : 'value'), item);
2837
+ if (itemValue === value || (isNullOrUndefined(itemValue) && value === null)) {
2838
+ return item;
2839
+ }
2802
2840
  }
2803
2841
  }
2804
2842
  }
@@ -2811,13 +2849,21 @@ var MultiSelect = /** @class */ (function (_super) {
2811
2849
  }
2812
2850
  if (this.enabled && !this.readonly) {
2813
2851
  var element = e.target.parentElement;
2814
- var customVal = element.getAttribute('data-value');
2815
- var value = this.allowObjectBinding ? this.enableVirtualization ?
2816
- this.getVirtualDataByValue(this.getFormattedValue(customVal)) :
2817
- this.getDataByValue(this.getFormattedValue(customVal)) : this.getFormattedValue(customVal);
2818
- if (this.allowCustomValue && ((customVal !== 'false' && value === false) ||
2819
- (!isNullOrUndefined(value) && value.toString() === 'NaN'))) {
2820
- value = customVal;
2852
+ var isNullChip = element.classList.contains(NULL_CHIP);
2853
+ var value = void 0;
2854
+ if (isNullChip) {
2855
+ value = null;
2856
+ }
2857
+ else {
2858
+ var customVal = element.getAttribute('data-value');
2859
+ var formattedVal = this.getFormattedValue(customVal);
2860
+ value = this.allowObjectBinding ? this.enableVirtualization ?
2861
+ this.getVirtualDataByValue(formattedVal) :
2862
+ this.getDataByValue(formattedVal) : formattedVal;
2863
+ if (this.allowCustomValue && ((customVal !== 'false' && value === false) ||
2864
+ (!isNullOrUndefined(value) && value.toString() === 'NaN'))) {
2865
+ value = customVal;
2866
+ }
2821
2867
  }
2822
2868
  if (this.isPopupOpen() && this.mode !== 'CheckBox') {
2823
2869
  this.hidePopup(e);
@@ -2826,6 +2872,14 @@ var MultiSelect = /** @class */ (function (_super) {
2826
2872
  this.inputElement.focus();
2827
2873
  }
2828
2874
  this.removeValue(value, e);
2875
+ if (!isNullChip) {
2876
+ var findValue = this.allowObjectBinding ? getValue((this.fields.value) ? this.fields.value : '', value) : value;
2877
+ if (isNullOrUndefined(this.findListElement(this.list, 'li', 'data-value', findValue)) &&
2878
+ this.mainList && this.listData) {
2879
+ var list = this.mainList.cloneNode ? this.mainList.cloneNode(true) : this.mainList;
2880
+ this.onActionComplete(list, this.mainData);
2881
+ }
2882
+ }
2829
2883
  value = this.allowObjectBinding ? getValue((this.fields.value) ? this.fields.value : '', value) : value;
2830
2884
  if (isNullOrUndefined(this.findListElement(this.list, 'li', 'data-value', value)) &&
2831
2885
  this.mainList && this.listData) {
@@ -2904,8 +2958,17 @@ var MultiSelect = /** @class */ (function (_super) {
2904
2958
  };
2905
2959
  MultiSelect.prototype.removeValue = function (value, eve, length, isClearAll) {
2906
2960
  var _this = this;
2907
- var index = this.allowObjectBinding ? this.indexOfObjectInArray(value, this.value) :
2908
- this.value.indexOf(this.getFormattedValue(value));
2961
+ var index = -1;
2962
+ if (value === null) {
2963
+ index = this.value.indexOf(null);
2964
+ }
2965
+ else if (this.allowObjectBinding) {
2966
+ index = this.indexOfObjectInArray(value, this.value);
2967
+ }
2968
+ else {
2969
+ var formattedValue = this.getFormattedValue(value);
2970
+ index = this.value.indexOf(formattedValue);
2971
+ }
2909
2972
  if (index === -1 && this.allowCustomValue && !isNullOrUndefined(value)) {
2910
2973
  index = this.allowObjectBinding ? this.indexOfObjectInArray(value, this.value) :
2911
2974
  this.value.indexOf(value.toString());
@@ -3091,7 +3154,13 @@ var MultiSelect = /** @class */ (function (_super) {
3091
3154
  MultiSelect.prototype.removeChip = function (value, isClearAll) {
3092
3155
  if (this.chipCollectionWrapper) {
3093
3156
  if (!(this.enableVirtualization && isClearAll)) {
3094
- var element = this.findListElement(this.chipCollectionWrapper, 'span', 'data-value', value);
3157
+ var element = void 0;
3158
+ if (value === null) {
3159
+ element = this.chipCollectionWrapper.querySelector('span.' + NULL_CHIP);
3160
+ }
3161
+ else {
3162
+ element = this.findListElement(this.chipCollectionWrapper, 'span', 'data-value', value);
3163
+ }
3095
3164
  if (element) {
3096
3165
  remove(element);
3097
3166
  }
@@ -3109,7 +3178,8 @@ var MultiSelect = /** @class */ (function (_super) {
3109
3178
  }
3110
3179
  };
3111
3180
  MultiSelect.prototype.updateChipStatus = function () {
3112
- if (this.value && this.value.length) {
3181
+ var showChips = this.value && this.value.length && !this.isValueOnlyNull();
3182
+ if (showChips) {
3113
3183
  if (!isNullOrUndefined(this.chipCollectionWrapper)) {
3114
3184
  (this.chipCollectionWrapper.style.display = '');
3115
3185
  }
@@ -3343,10 +3413,21 @@ var MultiSelect = /** @class */ (function (_super) {
3343
3413
  MultiSelect.prototype.getChip = function (data, value, e) {
3344
3414
  var _this = this;
3345
3415
  var itemData = { text: value, value: value };
3416
+ var isNullValue = value === null;
3417
+ var chipAttrs = { 'title': data, 'role': 'option', 'aria-selected': 'true' };
3418
+ if (isNullValue) {
3419
+ chipAttrs['data-value'] = 'null';
3420
+ }
3421
+ else {
3422
+ chipAttrs['data-value'] = value;
3423
+ }
3346
3424
  var chip = this.createElement('span', {
3347
- className: CHIP,
3348
- attrs: { 'data-value': value, 'title': data, 'role': 'option', 'aria-selected': 'true' }
3425
+ className: CHIP + (isNullValue ? ' ' + NULL_CHIP : ''),
3426
+ attrs: chipAttrs
3349
3427
  });
3428
+ if (isNullValue) {
3429
+ addClass([chip], NULL_CHIP);
3430
+ }
3350
3431
  var compiledString;
3351
3432
  var chipContent = this.createElement('span', { className: CHIP_CONTENT });
3352
3433
  var chipClose = this.createElement('span', { className: CHIP_CLOSE, attrs: { 'aria-hidden': 'true' } });
@@ -3368,7 +3449,8 @@ var MultiSelect = /** @class */ (function (_super) {
3368
3449
  this.renderReactTemplates();
3369
3450
  }
3370
3451
  else if (this.enableHtmlSanitizer) {
3371
- chipContent.innerText = data;
3452
+ var displayText = (data === 'null' || data === 'undefined') ? 'null' : data;
3453
+ chipContent.innerText = displayText;
3372
3454
  }
3373
3455
  else {
3374
3456
  chipContent.innerHTML = this.encodeHtmlEntities(data.toString());
@@ -4173,6 +4255,9 @@ var MultiSelect = /** @class */ (function (_super) {
4173
4255
  var value = this_1.allowObjectBinding ?
4174
4256
  getValue(((this_1.fields.value) ? this_1.fields.value : ''), this_1.value[this_1.value.length - 1]) :
4175
4257
  this_1.value[this_1.value.length - 1];
4258
+ if (value === null && this_1.value.length === 1) {
4259
+ return out_index_1 = index, "break";
4260
+ }
4176
4261
  if (this_1.isRemoveSelection && this_1.text) {
4177
4262
  data = this_1.text.replace(/,/g, delimiterChar + ' ') + delimiterChar + ' ';
4178
4263
  text = this_1.text.split(delimiterChar);
@@ -4318,6 +4403,18 @@ var MultiSelect = /** @class */ (function (_super) {
4318
4403
  }
4319
4404
  return null;
4320
4405
  };
4406
+ MultiSelect.prototype.isValueOnlyNull = function () {
4407
+ if (!this.value || this.value.length === 0) {
4408
+ return false;
4409
+ }
4410
+ return this.value.every(function (v) { return v === null || v === undefined; });
4411
+ };
4412
+ MultiSelect.prototype.getTextByValue = function (value) {
4413
+ if (value === null || value === undefined) {
4414
+ return 'null';
4415
+ }
4416
+ return _super.prototype.getTextByValue.call(this, value);
4417
+ };
4321
4418
  MultiSelect.prototype.initialValueUpdate = function (listItems, isInitialVirtualData, isInitialRender) {
4322
4419
  var _this = this;
4323
4420
  if (this.list) {
@@ -4330,7 +4427,10 @@ var MultiSelect = /** @class */ (function (_super) {
4330
4427
  this.removeListSelection();
4331
4428
  var formElement = closest(this.inputElement, 'form');
4332
4429
  if (!isNullOrUndefined(this.value)) {
4333
- for (var index = 0; !isNullOrUndefined(this.value[index]); index++) {
4430
+ for (var index = 0; index < this.value.length; index++) {
4431
+ if (this.isValueOnlyNull()) {
4432
+ continue;
4433
+ }
4334
4434
  value_2 = this.allowObjectBinding ?
4335
4435
  getValue(((this.fields.value) ? this.fields.value : ''), this.value[index]) :
4336
4436
  this.value[index];
@@ -4382,10 +4482,15 @@ var MultiSelect = /** @class */ (function (_super) {
4382
4482
  ((!(this.dataSource instanceof DataManager)) ||
4383
4483
  (this.dataSource instanceof DataManager && isInitialVirtualData)) && (!this.isAngular || !isInitialRender ||
4384
4484
  (isNullOrUndefined(formElement) && listItems && listItems.length > 0))
4385
- && !(this.mode === 'CheckBox' && this.enableVirtualization && this.value.length > this.getSummaryTagThreshold())) {
4485
+ && !(this.mode === 'CheckBox' && this.enableVirtualization && this.value.length > this.getSummaryTagThreshold())
4486
+ && value_2 !== null) {
4386
4487
  this.value.splice(index, 1);
4387
4488
  index -= 1;
4388
4489
  }
4490
+ if (value_2 === null && isNullOrUndefined(text)) {
4491
+ text = this.getTextByValue(value_2);
4492
+ isCustomData = true;
4493
+ }
4389
4494
  }
4390
4495
  else {
4391
4496
  text = this.getTextByValue(value_2);
@@ -4396,20 +4501,23 @@ var MultiSelect = /** @class */ (function (_super) {
4396
4501
  this.listData = savedListData;
4397
4502
  }
4398
4503
  }
4399
- if (((element && (element.getAttribute('aria-selected') !== 'true')) ||
4504
+ var shouldDisplayNull = (value_2 === null && this.value.length > 1);
4505
+ var shouldProcessElement = ((element && (element.getAttribute('aria-selected') !== 'true')) ||
4400
4506
  (element && (element.getAttribute('aria-selected') === 'true' && this.hideSelectedItem) &&
4401
- (this.mode === 'Box' || this.mode === 'Default'))) ||
4402
- (this.enableVirtualization && value_2 != null && text != null && !isCustomData)) {
4507
+ (this.mode === 'Box' || this.mode === 'Default'))) || (this.enableVirtualization && (text != null ||
4508
+ shouldDisplayNull) && !isCustomData && (value_2 != null || this.value.length > 1));
4509
+ if (shouldProcessElement) {
4403
4510
  var currentText = [];
4404
- var textValues = this.isDynamicRemoteVirtualData && text != null && text !== '' && index === 0 ? text : this.text != null && this.text !== '' && !this.text.includes(text) ? this.text + this.delimiterChar + text : text;
4511
+ var displayText = value_2 === null && (text === null || text === undefined) ? 'null' : text;
4512
+ var textValues = this.isDynamicRemoteVirtualData && displayText != null && displayText !== '' && index === 0 ? displayText : this.text != null && this.text !== '' && !this.text.includes(displayText) ? this.text + this.delimiterChar + displayText : displayText;
4405
4513
  currentText.push(textValues);
4406
4514
  this.setProperties({ text: currentText.toString() }, true);
4407
- this.addChip(text, value_2);
4515
+ this.addChip(displayText, value_2);
4408
4516
  this.addListSelection(element);
4409
4517
  }
4410
- else if ((!this.enableVirtualization && value_2 && this.allowCustomValue) ||
4518
+ else if ((!this.enableVirtualization && (value_2 || this.value.length > 1) && this.allowCustomValue) ||
4411
4519
  (this.enableVirtualization &&
4412
- value_2 &&
4520
+ (value_2 || this.value.length > 1) &&
4413
4521
  this.allowCustomValue &&
4414
4522
  ((!(this.dataSource instanceof DataManager)) ||
4415
4523
  (this.dataSource instanceof DataManager && isInitialVirtualData)))) {
@@ -4446,10 +4554,11 @@ var MultiSelect = /** @class */ (function (_super) {
4446
4554
  this.wireListEvents();
4447
4555
  }
4448
4556
  var currentText = [];
4449
- var textValues = this.text != null && this.text !== '' ? this.text + this.delimiterChar + text : text;
4557
+ var displayText = value_2 === null && (text === null || text === undefined) ? 'null' : text;
4558
+ var textValues = this.text != null && this.text !== '' ? this.text + this.delimiterChar + displayText : displayText;
4450
4559
  currentText.push(textValues);
4451
4560
  this.setProperties({ text: currentText.toString() }, true);
4452
- this.addChip(text, value_2);
4561
+ this.addChip(displayText, value_2);
4453
4562
  this.addListSelection(element);
4454
4563
  }
4455
4564
  }
@@ -4523,11 +4632,13 @@ var MultiSelect = /** @class */ (function (_super) {
4523
4632
  };
4524
4633
  MultiSelect.prototype.updateListSelection = function (li, e, length) {
4525
4634
  var customVal = li.getAttribute('data-value');
4635
+ var actualVal = customVal === 'null' ? null : customVal;
4526
4636
  var value = this.allowObjectBinding ?
4527
- this.getDataByValue(this.getFormattedValue(customVal)) : this.getFormattedValue(customVal);
4637
+ this.getDataByValue(this.getFormattedValue(actualVal))
4638
+ : this.getFormattedValue(actualVal);
4528
4639
  if (this.allowCustomValue && ((customVal !== 'false' && value === false) ||
4529
4640
  (!isNullOrUndefined(value) && value.toString() === 'NaN'))) {
4530
- value = customVal;
4641
+ value = actualVal;
4531
4642
  }
4532
4643
  this.removeHover();
4533
4644
  if (!this.value || ((!this.allowObjectBinding && this.value.indexOf(value) === -1) ||
@@ -5172,7 +5283,10 @@ var MultiSelect = /** @class */ (function (_super) {
5172
5283
  }
5173
5284
  this.checkClearIconWidth();
5174
5285
  if (!isNullOrUndefined(this.value) && (this.allowCustomValue || (this.listData && this.listData.length > 0))) {
5175
- for (var index = 0; !isNullOrUndefined(this.value[index]); index++) {
5286
+ for (var index = 0; index < this.value.length; index++) {
5287
+ if (this.isValueOnlyNull()) {
5288
+ continue;
5289
+ }
5176
5290
  var items = this.text && this.text.split(this.delimiterChar);
5177
5291
  if (!this.enableVirtualization) {
5178
5292
  data += (index === 0) ? '' : this.delimiterChar + ' ';