netizenorg / netnet.studio

netnet.studio is a hypermedia higherEd cyberspace for fully realizing the Web’s creative potential.
https://netnet.studio
GNU General Public License v3.0
30 stars 8 forks source link

Issue #237: Reordering steps in DemoExampleMaker reorderable list #250

Closed Cthomp7 closed 1 month ago

Cthomp7 commented 2 months ago

Fixed this issue: https://github.com/netizenorg/netnet.studio/issues/237#issuecomment-2083048829

Why was it happening?

Looking back at my code under the DEM _updateStep method I realized how the steps were being updated did NOT reflect the same as how the reorderable list was. In the _updateStep() method I was swapping the step being dragged with the step it was dragged onto. However, the reorderable list component doesn't 'swap' steps. For example, if there were 3 steps and you placed the last step in the first position it pushes the previous first step to second position and the previous second step to last.

How did I fix the issue

So instead of swapping the items in the _updateStep(), I have it remove the step from the array and place it in the newest index position and then update all steps.

nbriz commented 1 month ago

hey Chloe! finally getting around to testing this. i'm still noticing one strange bug (but it was there before this change) which is that when i use the up/down arrow buttons to re-order steps, i can't seem to move anything up to the first slot (the 0th index) it stops at 1.

but like i said, that was an issue before, so don't think its caused by any of these updates, so i'm gonna merge this!

Cthomp7 commented 1 month ago

hey Chloe! finally getting around to testing this. i'm still noticing one strange bug (but it was there before this change) which is that when i use the up/down arrow buttons to re-order steps, i can't seem to move anything up to the first slot (the 0th index) it stops at 1.

but like i said, that was an issue before, so don't think its caused by any of these updates, so i'm gonna merge this!

Okay good to know. I will take a look at that issue as soon as I have the chance.