Problem with date selector component

Hello, I'm seeing a problem with date population in a date control.
When applying a date to a date control (date1) and setting the value to another component (date2), the previous value of date1 is applied to date2 and then date1 is changed, even though the order is different in the code.
Below is my test screen.
Before
image

This is the code for the button.

date1.setValue("7/4/2022")
date2.setValue(date1.value)

After
image

testdate2 now has the value Jul 21st, which was the previous value for testdate1.

Saw this when the date values in a List were getting cleared off when adding new rows.

Hey @anoopshankaran! I think this might be happening because of the way that events run (there's no guarantee of the order). This is definitely possible, though. What is your current use case? When would you push this button to change the dates?

hello @victoria, the app that i'm working on has a Listview with several fields, including date selector. The Listview does not have events like add or remove rows (i find this strange) so this had to be done by mapping the Listview to a JSON array and to add or remove records modify the JSON array accordingly. I got the idea from here - http://community.retool.com/t/remove-specific-index-element-from-listview/5038/7.
On adding a new row, after the object array is modified, the previous set date fields reset to null, though not every time.
This would've been very very simpler if Listviews had inbuilt methods to add or remove specific records.

Ah, that definitely makes sense. I just added that feature request.

In the meantime, let me know if I can help debug your current app! If you'd like, you can DM me a link to your app and I can step in and take a look :slight_smile:

Thanks for putting up that request, @victoria.

Of course! We'll definitely be thinking about implementing this functionality with some future work.

Thank you for taking the time to share this with us, @anoopshankaran!