Buttons in Light Box

Instead of using my page to hold different parameters to filter my repeater I created a light box to hold buttons that will trigger a search.

When in the listing page you click a filter button and a light box opens with options.

These options are in forms of buttons.

I would like to code each button to react when the user clicks to search in the listing page.

Ex. Click “Breakfast” button in light box, light box closes, search bar slides out, breakfast appears in search bar and the repeater will show only breakfast.

I can take care of the rest of the “search function” coding as I have that but can’t get the buttons in the light box to work.

Current code:
import {local} from ‘wix-storage’;
import wixLocation from ‘wix-location’;
import wixWindow from ‘wix-window’;

wixWindow.lightbox.close();

$w.onReady( function () {

});

export function breakfast_click() {
let word = ‘breakfast’
local.setItem(‘searchWord’, word);
wixLocation.to(/search);
}

You aren’t closing the Lightbox. See the close() function. You can return the value that you want and then do your redirect.