itemId in event.context comes with extra characters appended at the end

Hi, I have buttons in a repeater. when I click the button, I am trying to recover the item clicked using event.context and $item(“dataset1”).getCurrentItem().

Every time the button was clicked, irrespective of where the click happened, code was always picking up the first element in the repeater.

So I printed out the event object and I saw that the issue is with the itemId in event.context. The snapshot of the console.log is below


If you see the itemId- I have marked out the extra characters that are coming at the end of the itemId. This is only happening with this particular repeater. None of the other repeaters have this in the itemId. Once I manually removed these characters from itemId using substring, then the right element started getting accessed.

Any idea, why itemId is getting “corrupted” this way? And this seems to be happening with this specific repeater and not consistently. On some item clicks this happens on others, it gives the right ItemId

It does not break things, e.g. we can set the ID when upload a csv to wix data with a _id field, that’s ok and still working.

Is that the itemId different from wix content manager?

Yes, the itemId in the content manager is without the “_p_2”.

I have not created any _id for these records. it is auto generated.

The issue is that it is not even a consistent behaviour. So I cannot even manage the correction through code. On some instances the right ItemId comes. But in other cases the itemId is corrupted.

I faced the same issue a day back, this is a bug. And yes it breaks things!

Can you contact Wix support? The relevant team will look into it.