i’m working with repeater a lot and with code
but recently sites and code that work perfect for long time start to have lots of errors after reloading the repeater
there was any update to the repeater code this week on wix side?
i’m getting this error on console:
comlink.ts:265 Uncaught (in promise) TypeError: Cannot read property ‘backgroundColor’ of undefined
at clientWorker.178227d0.bundle.min.js:2
at Object.set backgroundColor [as backgroundColor] (eval at evaluateBundle (clientWorker.178227d0.bundle.min.js:2), :3:51596)
at Object.keys.reduce.c.value.c.set.d.set [as backgroundColor] (eval at evaluateBundle (clientWorker.178227d0.bundle.min.js:2), :3:56622)
at is8so.js:1
at eval (eval at evaluateBundle (clientWorke…
Hi Naimi,
Yes, there have been some issues with repeaters this week that we are resolving. Can you share the URL for your site, describe what the problem is and how it’s happening, and provide steps for us to reproduce this bug? Thanks.
I am not sure if I just noticed something that’s been there forever, or if it’s something that recently changed…but just a few days ago I was trying to programmatically set the background of a repeater, and found that the repeater container object does not support the style mixin. I thought that was odd, since it was just a container. I actually had to put a container box inside the repeater container box and style that.
In general, I don’t get why there are 3 kinds of boxes/containers.
box
container box
repeater container
I understand box vs container box, but it seems like the repeater container should really just be a container box.
@naimibaby It would be great if you could create a test site with the minimal UI/code needed to reproduce the issue. That would help us troubleshoot the issue more efficiently.
As an alternative, you can open a ticket with Wix Customer Care to share your site info privately.
@naimibaby Thanks for setting this up! I followed the steps, but I’m not seeing any errors in the Console logs and no obvious issues in the repeater. Are you seeing bugs in this test site?
Edit: Is the issue that the repeater isn’t changing color? Still I’m not seeing any errors…
@marlowe-shaeffer i have now notice that its happen on chrome all the time
and on Microsoft Edge is working sometimes
sometimes after refreshing the page its not working
@marlowe-shaeffer Hi,
still have issue!!!
i have build by code from all over again
and also the test page
on the test page all working fine now until i’m using the search and then refresh the repeater to load al the data again
also i find an issue when im pushing the load repeater button one clicking on the repeater containers will not change colors
but pushing on the same button again it will work
i have notice that’s happen when I’m changing the data of the repeater
$w ( “#repeater” ). data
its happen on mobile as well - I’m using IOS 14.7.1 (latest) - Safari
i’m working from Israel
windows 10
chorme - latest version
same issue on Incognito
‘onItemReady’ Means: When the Item is ready, → do something.
If you set an event, (in this case: ‘$item(“#repeaterBox”).onMouseIn’) it set the event every time the item is load.
The first time the page load, it sets the event. When the repeater Is reload, it sets the event again. The third time the repeater reload, it sets the event for the third. And so on…
Having the same event for items more than once creates bugs.
Events should be sets only once when the page load.
The right code will be something like this:
$w.onReady( function () {
$w("#repeaterBox").onMouseIn( (event) => {
let $item = $w.at(event.context);
$item("#repeaterBox").style.backgroundColor="lightblue"
} );
} );
This code will set the event only once at the $w.onReady() function.
You can see an example for it here:
The reason it worked for you until now is a mystery :-).
Now I see. What you experience is not related to repeaters or events.
It’s a bug that style properties return “undefined” when set in Editor.
It’s a known issue, and we have a ticket on it. @chaim-kram FYI
Meanwhile, the workaround is to check also if the style argument is 'undefined. if (! $item ( “#repeaterBox” ). style || $item ( “#repeaterBox” ). style . backgroundColor !==…
@binyaminm I made a comment like yours above (Re-quoted below). Is my observation correct? There is a bug where the repeater container doesn’t have the style mixin? The solution you gave above only tests for undefined, but it still doesn’t allow you to set the background color on the repeater container. I had to get around this by putting a container box inside the repeater container and styling that background. Is this a bug? Should I be able to call $w(‘#someRepeaterContainer’).style ?
— My quote from above —
I am not sure if I just noticed something that’s been there forever, or if it’s something that recently changed…but just a few days ago I was trying to programmatically set the background of a repeater, and found that the repeater container object does not support the style mixin. I thought that was odd, since it was just a container. I actually had to put a container box inside the repeater container box and style that.
@polkaset
You can’t change color on repeater-container the direct way.
Polkaset → you are right, only a box inside container can solve the issued situation. And yes, as i can remember → it was always like that (old issue).