From 992cb6b3108d67715fe3eaa3afbcd855e8092190 Mon Sep 17 00:00:00 2001 From: chfhtw Date: Thu, 16 Apr 2026 16:00:01 +0200 Subject: [PATCH] !some(!true) is the same as every(true) and we don't need to check for the originalFrame since only the moving item was in there and no other item hence no occupier --- public/js/composables/GridLogic.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/js/composables/GridLogic.js b/public/js/composables/GridLogic.js index 781e94613..d3d9b6ade 100644 --- a/public/js/composables/GridLogic.js +++ b/public/js/composables/GridLogic.js @@ -120,7 +120,8 @@ class GridLogic { // checks if target contains widget with the same high and width let occupiersData = occupiers.map(occupier => this.data[occupier]); let occupiersFrame = occupiersData.map(occupier => occupier.frame).flat(); - if (!occupiersFrame.some(frame => !currItem.frame.includes(frame)) && !occupiersFrame.some(frame => originalFrame.includes(frame))){ + if (occupiersFrame.every(frame => currItem.frame.includes(frame))) { + // every slot of all items in the target zone is inside said zone let replaceUpdate = []; let newOccupierFrames = []; for(let f of originalFrame){