How to prevent input reset on a dynamic list?

Hi all,

I have here a list of repeating invoices whereby I allow my users to easily change the email (using an input field) for where their invoices are going to be sent to.

Now here’s the thing, if we look at this example here

If I delete invoice ORC1019, all the input values below this row get reset to their original value (shown in image below). The edited values above it remain the same, but this is only occuring on the rows below it.

Essentially I’m loading this data using a custom state, i.e if the X button is clicked, it minus the item of the list. I’m assuming as soon as an item is removed or added of a list. Bubble is doing a quick recalculation of the list and hence causing that input reset?

My question is, is there a way to force the list to be static, so that no matter which row I delete, the input elements don’t get reset to their original value?

Hello! You are correct that we are automatically recalculating the list which is causing the reset. The solution here would be to not use custom states, and instead, have this input set to autobind to a field from your database. This should maintain each value in the correct row as expected.

Its important to note that you can still have this setup and have a UI that reflects more of a “draft / save” functionality - the key would be autobinding to a specific draft field, and then when the save button is clicked you can recursively iterate through the list of items in the RG and update the “real” field to match the “draft” field.

I should probably clarify that data presented is from an external API call and I don’t want to save it to the database unless necessary.

Would the :make static function help in this instance? Or is there a hacky way to force the list to become static so it doesn’t need to constantly do a lookup?

This topic was automatically closed after 70 days. New replies are no longer allowed.