Skip to content

Commit

Permalink
work for the #7893
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitry-kurmanov committed Feb 21, 2024
1 parent 443768b commit d9e8de6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/dragdrop/ranking-select-to-rank.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@ export class DragDropRankingSelectToRank extends DragDropRankingChoices {
return dragOverNode;
}

if (this.parentElement.isEmpty()) {
if (
this.parentElement.rankingChoices.length === 0 ||
this.parentElement.unRankingChoices.length === 0
) {
let toContainer: HTMLElement = dragOverNode.closest("[data-ranking='to-container']");
let fromContainer: HTMLElement = dragOverNode.closest("[data-ranking='from-container']");

if (!!toContainer) return toContainer;
if (!!fromContainer) return fromContainer;
return null;
}

return super.findDropTargetNodeByDragOverNode(dragOverNode);
Expand Down

0 comments on commit d9e8de6

Please sign in to comment.