Hi there,
I have encountered this issue a few days ago and for the life of me I cannot figure out what is wrong
Here is what happens in pictures:
then:
finally:
I have a repeater that is populated by code, it does display correctly. After a bit of time (less than 2 seconds) it just starts disappearing (first the profile picture then the name). I am further confused by the fact that if I click on it before anything disappears, I correctly retrieve the ID of the user affiliated to the element, however when I click on it after it has disappeared, the ID appears to have an extra “_p_1” at the end (“8fa24dea-4723-4c0c-bc53-3eb7c685036d” becomes “8fa24dea-4723-4c0c-bc53-3eb7c685036d_p_1”)
The repeater works perfectly well when I use this function (it does not disappear, ID works well):
function setSidePanel(userId, j) {
let container, img, name;
if (j == 0) {
container = "#repeaterInUser";
img = "#imageIn";
name = "#textNameIn";
dataset = "Members";
} else if (j == 1) {
container = "#repeaterSciUser";
img = "#imageSci";
name = "#textNameSci";
dataset = "InfluencerMembers";
}
wixData.query(dataset)
.eq("_id", userId)
.find()
.then(async (results) => {
let currentUser = [];
for (let i = 0; i < results.items[0].interactions.length; i++) {
let x = results.items[0].interactions[i];
let y = [{ '_id': x }];
currentUser = currentUser.concat(y);
}
$w(container).onItemReady(async ($w, itemData, index) => {
$w(img).src = (await getProfile(itemData._id, 1, 1, dataset));
$w(name).text = (await getProfile(itemData._id, 0, 1, dataset));
});
$w(container).data = currentUser;
});
however this function causes it to disappear:
function setSidePanelFilter(filter) {
let container, img, name, j;
j = parseInt(memory.getItem("j"));
if (j == 0) {
container = "#repeaterInUser";
img = "#imageIn";
name = "#textNameIn";
dataset = "InfluencerMembers";
} else if (j === 1) {
container = "#repeaterSciUser";
img = "#imageSci";
name = "#textNameSci";
dataset = "Members";
}
wixData.query(dataset)
.contains("fullName", filter)
.find()
.then(async (results) => {
if (results.items.length > 0) {
let currentUser = [];
for (let i = 0; i < results.length; i++) {
let x = results.items[i]._id;
let y = [{ '_id': x }];
currentUser = currentUser.concat(y);
}
$w(container).onItemReady(async ($w, itemData, index) => {
$w(img).src = (await getProfile(itemData._id, 1, 1, dataset));
$w(name).text = (await getProfile(itemData._id, 0, 1, dataset));
});
$w(container).data = currentUser;
} else {
console.log("query empty")
}
});
}
Please let me know if I can provide any additional information