Wix Login removes html property on my text when login is successful

I change the html property of a textbox in a repeater as follows:

$item( ‘#text31’ ).html = ‘

’ + itemData.answer + ‘

On the same page, if the user logs in using the Wix login page from the top menu, when they are returned to the page, the page re-renders and shows the html as text, including the HTML markup. Please see pic below. You can see how the html property has been lost and we just see the markup syntax.


As far as I know I have no way to control this. Does anyone know why the html property is being ignored on rerendering? How can I stop this, or force the page to keep the original rendering. Everything I has seen written so far on wix rendering does not help or have useful examples.

Thanks

Post the rest of the code.

The code (here below) feels IMHO kind of irrelevant. My question is, when the Wix Login dialog is closed after successfully logging and I am returned to the calling page. What is happening with the rendering? Is $w.onReady event triggered again? i.e. does the page code get loaded again on being redirected back to the calling page from a successful Wix Login? If it doesn’t and (excuse my non-technical description) we are simply closing the login overlay, then it shouldn’t need to re-render the page and lose the html formatting?

function tableresetter(){
$w( “#FAQParentDataset” ).onReady(() => {
$w( “#repeater1” ).forEachItem( ($item, itemData, index) => {
$item( ‘#text31’ ).html = ‘

’ + itemData.answer + ‘


let varFAQTitle = itemData.title;
if (itemData.hasInfoResource === “No” ){
queryFAQs(varFAQTitle)
.then( (items) => {
if (wixWindow.formFactor === “Desktop” ){
if (items.length !== 0 ){
$item( “#table1” ).rows = items;
if ($item( “#table1” ).collapsed === true ){
$item( “#table1” ).expand();
}
}
}
else {
$item( “#table2” ).rows = items;
if ($item( “#table2” ).collapsed === true ){
$item( “#table2” ).expand();
}
}
})
. catch (error => {
console.log(error)
} );
}
else {
queryInfoLinks(varFAQTitle)
.then( (items) => {
if (wixWindow.formFactor === “Desktop” ){
if (items.length !== 0 ){
$item( “#table1” ).rows = items;
$item( “#table1” ).collapse();
$item( “#InfoLinksButton” ).show();
$item( “#TextClickBelowFAQs” ).text = “Click for more information” ;
}
}
else {
if (items.length !== 0 ){
$item( “#table2” ).rows = items;
$item( “#table2” ).collapse();
$item( “#InfoLinksButton” ).show();
$item( “#TextClickBelowFAQs” ).text = “Click for more information” ;
}
}

}) 
    . **catch** (error => { 
  console.log(error) 
} ); 

}

if (itemData.parentQuestionText !== null && itemData.parentQuestionText !== “undefined” ){
$item( “#FAQDrillButton” ).show();
}
if (itemData.parentQuestionText === null || itemData.parentQuestionText === undefined || itemData.parentQuestionText === “” ){
$item( “#FAQDrillButton” ).hide();
}
});
});
$w( ‘#repeater1’ ).show()
.then(
GetBookmarkStatus()
)
}

dataset.onReady should be inside another function as the dataset might be ready before the function gets called.
Therefore get theataset.onReady out and put is in the $w,onready(). Call tableresetter() from inside the dataset.onReady block if the user is logged in.
Also add a user.onLogin event handler and call tableresetter() from there.

Hi, thanks for the suggestions but it doesn’t help me. If I know what’s happening when the user successfully logs i.e. does $w.onready() get called again once the login has completed? If it does I can change my code to suit. If it doesn’t … it’s a bug…

It would really help if the ‘on success’ behaviour of the Wix logon event was adequately documented .i.e what happens when the user successfully logs in and what elements of the behaviour can we change. My understanding is none of it…

See:
https://www.wix.com/corvid/reference/wix-users/onlogin
and since it’s sometimes buggy, see also:
promptLogin().then() :
https://www.wix.com/corvid/reference/wix-users/promptlogin