I created a page to test this. There is nothing on the page but a single textbox called txtTest. I want the textbox to be hidden in Mobile. The Hidden on Load and Collapsed on Load properties are not checked. Here’s the only code on the page, taken from a WIX tutorial page (Velo Tutorial: Displaying Elements in Mobile Only | Help Center | Wix.com):
import wixWindow from ‘wix-window’;
$w.onReady( function () {
if (wixWindow.formFactor === “Mobile”) {
$w(“#txtTest”).hide();
}
} );
It doesn’t work. The element still appears in both Desktop and Mobile, even after published and viewed on an actual mobile phone.
If I change ‘Mobile’ to ‘Desktop’, it hides it in both. It doesn’t seem to recognize ‘Mobile’. It seems to think mobile is also desktop.
Try this
$w(“#txtTest”).text = wixWindow.formFactor;
Run it in your phone and see what the value gets on the text, is it Desktop there is something wrong.
Hey
If you have a mac that you use to work on install xcode and then execute the iOS Simulator and use that for checking the site but it needs to be published to do 100% secure checks. Have you tried the device simulator in Chrome Dev Tools?