Bug in "Reorder List" Component - "On item moved" Event Not Reflecting New Order

@weweb-team @DanielL

Hi everyone,

I’m running into an issue with the “Reorder List” component and wondering if anyone else has experienced this or has any suggestions. I’ve set up a draggable list tied to a collection with an “order” field. I also added a workflow triggered by the “On item moved” event to update the order in the database. However, when I try to access the “Event” value (either to get the moved item or the updated order of the whole list), it doesn’t change and keeps showing the same value as before the move.

I’m thinking this might be a bug or something I’m setting up wrong. Here are a couple of possibilities I’ve considered:

  1. Component Bug: It seems like the “On item moved” event might not be updating the “Event” to reflect the new order. To test this, I added a “Log” action in the workflow to check what the “Event” returns, but I’m still not sure what it’s supposed to include. Has anyone seen this in the documentation or reported it to support?

  2. No Automatic Update: Maybe the component doesn’t update the database automatically, and I need to handle it manually in the workflow. I’ve tried identifying the moved item from the “Event” and adjusting the “order” field based on its new visual position, but without direct access to the updated order, it gets tricky. This would mean fetching the collection list and recalculating everything (e.g., incrementing the “order” of subsequent items), which feels like too much work for something I expected to be automatic.

Does anyone have tips on how to fix this? I’ve tested logging the “Event,” but it still doesn’t show the change. Am I missing something in the setup, or could this be a bug? If it’s a bug, should I reach out to WeWeb support?

Thanks so much for your help!

1 Like

Hi @saulo260 :waving_hand:

Great question! Here’s a video explaining how to update your DB using an order value and the Reorder List element: Updating DB with Reorder List element

Hope it helps!

Joyce, thank you for sending the instructions.
I will review the information and get back to you with my results once I have completed the verification.
Best regards

Hi Joyce! I am having a problem with reorder lists when the collection is set to realtime. My “on item moved” workflow is set up exactly the same as in your video, the only difference is the collection linked to the items is a realtime table in supabase–it has an order column and everything updates properly on the backend.

Your workflow + realtime table enabled. Because the table is being updated, the stack element immediately checks the index of the collection and reverts the items back to their original position.

1/2

1 Like

Your workflow + fetch collection + realtime table enabled. Here I am fetching the collection at the end of the “on item moved” workflow, which to me appears to be more evidence that the stack element is immediately updating to reflect the old index order of the collection.

Your workflow + realtime table DISABLED in supabase. This is the intended outcome.

In all three videos the supabase table is updating properly to reflect the order number, but in the first two videos the element in weweb is returning things back to their original index. Maybe there needs to be some kind of debounce or delay before the element updates on its own? Could you see if you can replicate the problem?

2/2

1 Like