I have the strangest “bug”:
I have a function that opens a lightbox and within that lightbox a link is showed to open another website in a new tab.
This new website can also be opened with a button from within the lightbox.
If I dont click this link I can close the lightbox with a button with velo-code - no problem.
But when I check the link and a new tab opens - the lightbox in the old tab can not be closed anymore.
This happens in all browsers.
The whole code on the close-button is not even called once the new tab was opened.
There is a button called “buttonLink” and this button has NO handler on it. It works with the above code.
And this is the call for closing the lightbox:
export function buttonNo_click ( event ) {
wixWindow . lightbox . close ();
}
It works fine until the “buttonLink” is clicked.
This may not be the problem but I have had this happen before. Are you using the button that was on the Lightbox template? The button on the templates are used to close the lightbox and if you try to connect code to it sometimes it acts in a weird way. I would try to delete the button, add your own, and then just rename the new button to buttonLink.
Thanks Jarod!
Actually I could solve it the other way round:
I indeed had my own button in the lightbox with wixWindow . lightbox . close (); code.
I deleted it and chose a close button from the lightbox set triggers. And now it works. Let’s see how long…