@syncfusion/ej2-dropdowns 32.1.21 → 32.1.23

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.
@@ -1650,7 +1650,7 @@ let DropDownBase = class DropDownBase extends Component {
1650
1650
  const newQuery = this.getQuery(eventArgs.query);
1651
1651
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
1652
1652
  if (this.isVirtualizationEnabled && (listItems.count !== 0 &&
1653
- listItems.count < (this.itemCount * 2)) && !this.appendUncheckList) {
1653
+ listItems.count < (this.itemCount * 2))) {
1654
1654
  if (newQuery) {
1655
1655
  for (let queryElements = 0; queryElements < newQuery.queries.length; queryElements++) {
1656
1656
  if (this.getModuleName() === 'multiselect' && this.isCheckBoxSelection && (newQuery.queries[queryElements].e && (newQuery.queries[queryElements].e.operator === 'notequal' ||
@@ -20106,13 +20106,11 @@ class CheckBoxSelection {
20106
20106
  prepend([this.parent.filterParent], args.popupElement);
20107
20107
  attributes(this.filterInput, {
20108
20108
  'aria-disabled': 'false',
20109
- 'role': 'combobox',
20109
+ 'role': 'searchbox',
20110
20110
  'autocomplete': 'off',
20111
20111
  'autocapitalize': 'off',
20112
20112
  'spellcheck': 'false',
20113
- 'aria-label': 'multiselect',
20114
- 'aria-expanded': 'true',
20115
- 'aria-controls': args.popupElement.id
20113
+ 'aria-label': 'multiselect'
20116
20114
  });
20117
20115
  this.clearIconElement = this.filterInput.parentElement.querySelector('.' + clearIcon);
20118
20116
  if (!Browser.isDevice && this.clearIconElement) {
@@ -23409,13 +23407,33 @@ let Mention = class Mention extends DropDownBase {
23409
23407
  this.hidePopup();
23410
23408
  return;
23411
23409
  }
23410
+ const prevSiblingIsChip = (() => {
23411
+ if (!this.isContentEditable(this.inputElement) || !this.range || !this.range.startContainer) {
23412
+ return false;
23413
+ }
23414
+ const startContainer = this.range.startContainer;
23415
+ const textNode = startContainer.nodeType === Node.TEXT_NODE ? startContainer : (() => {
23416
+ const idx = Math.min(this.range.startOffset, startContainer.childNodes.length - 1);
23417
+ const child = startContainer.childNodes[idx] || startContainer.firstChild;
23418
+ return child && child.nodeType === Node.TEXT_NODE ? child : null;
23419
+ })();
23420
+ if (!textNode) {
23421
+ return false;
23422
+ }
23423
+ const firstChar = (textNode.data || '').replace(/\u200B/g, '').replace(/\u00A0/g, ' ').charAt(0);
23424
+ let previousSibling = textNode.previousSibling;
23425
+ while (previousSibling && ((previousSibling.nodeType === Node.TEXT_NODE && !(previousSibling.data || '').trim()) || (previousSibling.tagName === 'BR'))) {
23426
+ previousSibling = previousSibling.previousSibling;
23427
+ }
23428
+ return firstChar === this.mentionChar && !!(previousSibling && previousSibling.classList && previousSibling.classList.contains('e-mention-chip'));
23429
+ })();
23412
23430
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
23413
23431
  if (((!currentRange || !lastWordRange) || (!lastWordRange.includes(this.mentionChar) && !this.requireLeadingSpace && !this.allowSpaces)) || e.code === 'Enter' || e.keyCode === 27 ||
23414
23432
  (lastWordRange.match(Regex) && lastWordRange.match(Regex).length > 1) ||
23415
23433
  (this.isContentEditable(this.inputElement) && this.range.startContainer &&
23416
23434
  this.range.startContainer.previousElementSibling && this.range.startContainer.previousElementSibling.tagName !== 'BR' && this.range.startContainer.textContent.split('').length > 0 &&
23417
23435
  (rangetextContent.length === 1 || rangetextContent[rangetextContent.length - 2].indexOf('') === -1 ||
23418
- this.range.startContainer.nodeType === 1))) {
23436
+ this.range.startContainer.nodeType === 1)) && !prevSiblingIsChip) {
23419
23437
  if (isValid && this.isPopupOpen && this.allowSpaces && currentRange && currentRange.trim() !== '' && charRegex.test(currentRange) && currentRange.indexOf(this.mentionChar) !== -1
23420
23438
  && !this.isMatchedText() && this.list && e.code !== 'ArrowDown' && e.code !== 'ArrowUp' && e.code !== 'Enter') {
23421
23439
  this.queryString = currentRange.substring(currentRange.lastIndexOf(this.mentionChar) + 1).replace('\u00a0', ' ');
@@ -23896,15 +23914,13 @@ let Mention = class Mention extends DropDownBase {
23896
23914
  }
23897
23915
  }
23898
23916
  checkCollision(popupEle) {
23899
- if (!Browser.isDevice || (Browser.isDevice && !(this.getModuleName() === 'mention'))) {
23900
- const coordinates = this.getCoordinates(this.inputElement, this.getTriggerCharPosition());
23901
- this.collision = isCollide(popupEle, null, coordinates.left, coordinates.top);
23902
- if (this.collision.length > 0) {
23903
- popupEle.style.marginTop = -parseInt(getComputedStyle(popupEle).marginTop, 10) + 'px';
23904
- this.isCollided = true;
23905
- }
23906
- this.popupObj.resolveCollision();
23917
+ const coordinates = this.getCoordinates(this.inputElement, this.getTriggerCharPosition());
23918
+ this.collision = isCollide(popupEle, null, coordinates.left, coordinates.top);
23919
+ if (this.collision.length > 0) {
23920
+ popupEle.style.marginTop = -parseInt(getComputedStyle(popupEle).marginTop, 10) + 'px';
23921
+ this.isCollided = true;
23907
23922
  }
23923
+ this.popupObj.resolveCollision();
23908
23924
  }
23909
23925
  getTriggerCharPosition() {
23910
23926
  let mostRecentTriggerCharPos;
@@ -23953,7 +23969,7 @@ let Mention = class Mention extends DropDownBase {
23953
23969
  this.popupObj.element.removeAttribute('style');
23954
23970
  this.popupObj.element.removeAttribute('aria-disabled');
23955
23971
  }
23956
- if (this.list.classList.contains('e-nodata')) {
23972
+ if (this.list && this.list.classList.contains('e-nodata')) {
23957
23973
  this.list = null;
23958
23974
  }
23959
23975
  }
@@ -24388,14 +24404,15 @@ let Mention = class Mention extends DropDownBase {
24388
24404
  value = this.displayTempElement.innerHTML;
24389
24405
  }
24390
24406
  if (this.isContentEditable(this.inputElement)) {
24407
+ const defaultSuffix = this.isRTE ? '&#8203;' : '';
24391
24408
  if (Browser.isAndroid) {
24392
- return '<span contenteditable="true" class="e-mention-chip">' + showChar + value + '</span>'.concat(typeof this.suffixText === 'string' ? this.suffixText : '&#8203;');
24409
+ return '<span contenteditable="true" class="e-mention-chip">' + showChar + value + '</span>'.concat(typeof this.suffixText === 'string' ? this.suffixText : defaultSuffix);
24393
24410
  }
24394
24411
  else if (Browser.info.name === 'mozilla') {
24395
- return '<span>&#65279;<span contenteditable="false" class="e-mention-chip">' + showChar + value + '</span>&#65279;</span>'.concat(typeof this.suffixText === 'string' ? this.suffixText : '&#8203;');
24412
+ return '<span>&#65279;<span contenteditable="false" class="e-mention-chip">' + showChar + value + '</span>&#65279;</span>'.concat(typeof this.suffixText === 'string' ? this.suffixText : defaultSuffix);
24396
24413
  }
24397
24414
  else {
24398
- return '<span contenteditable="false" class="e-mention-chip">' + showChar + value + '</span>'.concat(typeof this.suffixText === 'string' ? this.suffixText : '&#8203;');
24415
+ return '<span contenteditable="false" class="e-mention-chip">' + showChar + value + '</span>'.concat(typeof this.suffixText === 'string' ? this.suffixText : defaultSuffix);
24399
24416
  }
24400
24417
  }
24401
24418
  else {