Repeater is not fully updated

Hi,
I am using a repeater to show some information of items, each repeater item contains text title and text description, description is by default collapsed and hidden.
description text will be shown by code only if there is a description data exist.
When I load a repeater with the data first time, everything is ok, the description text is shown\hidden according to the description data I pass.
When I try to reload the repeater by calling
repeater.data = []
repeater.data = newData
Somehow it keep remembering the previous description info, so, if the description is shown before, and should be hidden now, it still shown, and couldn’t find a way to fully refresh the repeater.
It seems that the repeater is not fully cleaned when loading the the newData.

Any idea how to clean the repeater before showing the newData? repeater.data = [] probably is not working.

Thanks
Ammar

When is the data being updated? Should newData be called when the page loads or does it update based on some input that a user does on the page that displays the repeater element?

It is updated via a button onclick event

@ammarbader can you try to expand your description before updating the repeater data? Also you shouldn’t have to clear the data before assigning the new repeater data.

My thinking is that while collapsed the description is physically unmounted from the page so when you update the data and remount it the old information gets stuck.

You can also try to wrap your description in a container box and then unmount the box element instead of the description.

@amotor Thank you a lot, your suggestion worked as charm, perfect solution, again, thanks a lot :slightly_smiling_face: