I tried this in site code:
import wixWindow from ‘wix-window’;
$w.onReady( function () {
if (wixWindow.formFactor === “Desktop”){
console.log(“It’s Desktop”);
$w(“#quickSearchBar”).show();
$w(“#quickSearchButton”).show();
}
else {
console.log(“It’s Mobile”);
}
});
I hide #quickSearchBar and #quickSearchButton in Mobile mode. But when i run it in mobile mode, console still log: “It’s desktop” ? and raise error “TypeError: $w(…).show is not a function”. I want Wix skip that code in mobile mode but i don’t know how.
Please help me !!