@syncfusion/ej2-lists 33.1.44 → 33.2.3

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.
@@ -4313,17 +4313,19 @@ let Sortable = Sortable_1 = class Sortable extends Base {
4313
4313
  if (dropInst.element.querySelector('.e-list-nrt')) {
4314
4314
  curIdx = curIdx - 1;
4315
4315
  }
4316
- if (this.curTarget === this.target && e.target === this.curTarget) {
4316
+ const sortableTargetElement = this.getSortableElement(e.target, dropInst) || e.target.querySelector('.e-grabbed');
4317
+ const isDroppedOnContainer = dropInst.element === e.target && !sortableTargetElement;
4318
+ if (this.curTarget === this.target && sortableTargetElement === this.curTarget) {
4317
4319
  curIdx = prevIdx;
4318
4320
  }
4319
- if (dropInst.element === e.target || (!isPlaceHolderPresent && this.curTarget === this.target)) {
4321
+ if (isDroppedOnContainer || (!isPlaceHolderPresent && this.curTarget === this.target)) {
4320
4322
  const beforeDropArgs = {
4321
4323
  previousIndex: prevIdx, currentIndex: curIdx,
4322
4324
  target: e.target, droppedElement: this.target, helper: e.helper, cancel: false
4323
4325
  };
4324
4326
  this.trigger('beforeDrop', beforeDropArgs, (observedArgs) => {
4325
- if ((dropInst.element === e.target || (typeof e.target.className === 'string' && e.target.className.indexOf('e-list-nrt') > -1) || (typeof e.target.className === 'string' && e.target.className.indexOf('e-list-nr-template') > -1)
4326
- || e.target.closest('.e-list-nr-template')) && !observedArgs.cancel) {
4327
+ if ((isDroppedOnContainer || (typeof sortableTargetElement.className === 'string' && sortableTargetElement.className.indexOf('e-list-nrt') > -1) || (typeof sortableTargetElement.className === 'string' && sortableTargetElement.className.indexOf('e-list-nr-template') > -1)
4328
+ || sortableTargetElement.closest('.e-list-nr-template')) && !observedArgs.cancel) {
4327
4329
  this.updateItemClass(dropInst);
4328
4330
  dropInst.element.appendChild(this.target);
4329
4331
  this.trigger('drop', {