From 853492ea53a88dc21bc0a6c70f0c8fcf0f479c9a Mon Sep 17 00:00:00 2001 From: Ian Petzer Date: Fri, 25 Sep 2020 13:25:18 +0200 Subject: [PATCH] Update drag-coordinator.indexOf implementation to not use findIndex as hasMany does not support this --- addon/services/drag-coordinator.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/addon/services/drag-coordinator.js b/addon/services/drag-coordinator.js index d9f81ee..aae937b 100644 --- a/addon/services/drag-coordinator.js +++ b/addon/services/drag-coordinator.js @@ -5,9 +5,13 @@ import { isEqual } from '@ember/utils'; function indexOf(items, a) { - return items.findIndex(function (element) { - return isEqual(element, a); + var returnIndex=null; + items.forEach(function(element, index) { + if (isEqual(element, a)) { + returnIndex=index; + } }); + return returnIndex; } function swapInPlace(items, a, b) {