I have a lightbox containing a single image and text connected to my dataset/collection. When I click to open the lightbox to display the particular item I want, the very first item in the collection always displays for a brief flash moment before the correct item displays. This is pretty frustrating, and not sure how to go about fixing/optimizing this. Any help would be hugely appreciated.
Here is the code I’m using in the lightbox:
import { lightbox } from ‘wix-window’ ;
import wixData from ‘wix-data’ ;
$w . onReady (() => {
let theItem = lightbox . getContext (); //this is the item you took from page
let postID = theItem._id ; // this is the field key for the item ID in the database collection
$w ( “#myCollection” ). setFilter ( wixData . filter ()
. eq ( “_id” , postID )
)
});