Question:
I have a gallery of 35 items. According to the Velo reference if I want to change items (in this case I’m swapping 2 images around)… I have to assign .items to a local Var then change them there then reassign the local variable back to the gallery.
In this example the gallery reduces the 35 items to 25 items even if I comment out the actual swapping of the 2 items. Just assigning to a variable and re-assigning to the gallery drops 10 items !!! anyone got any clues ?
Product:
Wix Editor Gallery
What are you trying to achieve:
[Explain the details of what you are trying to achieve. The more details you provide, the easier it is to understand what you need.]
What have you already tried:
Dozens of approaches… none fix it.
Any help greatly appreciated.
Additional information:
let copyGallery = $w(“#gallery1”).items;
console.log(“Copy gallery size = “, copyGallery.length);
console.log(“swapping Image …”);
/* let currentSourceImage = copyGallery[moveItemIndex];
copyGallery[moveItemIndex] = copyGallery[event.itemIndex];
copyGallery[event.itemIndex] = currentSourceImage; */
$w(”#gallery1”).items = copyGallery;
console.log("Gallery size after swap = ", $w(‘#gallery1’).items.length);