I was recently trying out divs reshuffling with ember-animated via dragging (tutorial 24 in Edward Faulkner’s talk in 2018 - GitHub - ef4/living-animation: Interactive EmberConf 2018 Slides) with Octane and I’m facing an absolute edge-case issue where if my one div moves and collides with two divs at the same time, it stops the activeSprite mid motion and continuously keeps trying to swap within all three touching divs.
For now I tried a time-based movement but that causes issues with the fluidity and requires fine-tuning.
I was wondering if any of you’ve faced the same and had any hints on a fix for the same.
I tried googling and reading docs and examples but couldn’t find anything concrete.
Here is my onCollision function -
drag(activeSprite, {
others,
onCollision(otherSprite) {
let myModel = activeSprite.owner.value;
let otherModel = otherSprite.owner.value;
let myPriority = myModel.sortedPriorityValue;
set(myModel, 'sortPriority', otherModel.sortedPriorityValue);
set(otherModel, 'sortPriority', myPriority);
}
});
Hi Akansha, it looks like an exception is being thrown, but I can’t see the real stack trace.
Can you try enabling “pause on caught exceptions” in Chrome devtools right before you reproduce the bug? And then share where the debugging places you?
Finally found the issue with it, seems like the set inside the generator function is what’s causing the issue due to the way it updates values (in relation to the run loop)
A helpful thread I found incase anyone wants to check it out for reference is