Is there a reason that mobile editor does not recognize the formfactor as mobile? This is painful for testing as I have many elements that are hidden and it’s causing the code to error. When I run it live this is fine because I can use if (wixWindow.formfactor === "Desktop)
Yeah, formFactor for mobile in Editor is not recognize in Editor. Im guessing the editor can detect that you are still using desktop/ laptop. Though, I tried the formFactor Mobile is working fine on live mobile.
If you are using the same elements for both Destop and Mobile then you should not hide it cause it will really give you an error. If it suits your project, try using collapse and expand event.
Thanks DA. With Chrome Dev tools you can run the website as “Mobile” and everything runs well. So, that’s the work around but it still requires you to publish and take it out of preview, which is brutal.
This should definitely be something that down the line is addressed on Wix’s end. For now, we’ll work around it.
Just chiming in to say this issue is still live and makes it tough to work with mobile-specific .show(); and .hide(); commands. It would be very helpful to have wixWindow.formFactor reflect the preview mode being used. The code does seem to work fine on mobile devices when it’s published.
I’ve double-checked, and $w(console.log(wixWindow.formFactor)); outputs “Desktop” in Preview mode in both Desktop and Mobile views.
Can anyone confirm if this is still a feature to be added, and if so what the expected timelines are?