Hi guys! Just had a chat trying to figure out what was going wrong with my experience when dealing with elements that collapse/expand in the mobile view.
When working with formFactor before, I noticed that when trying to create effects specifically on the mobile version of the site that I wouldn't see them in the mobile preview if I set the formFactor to "Mobile". In fact, the only way I could preview my effects is if I set the formFactor to "Desktop". Seeing that it worked, I just went along with it and assumed that maybe it was "backwards" for some reason.
After getting the result successfully verified in the Wix mobile site preview environment (again while set to "Desktop"), I had checked to see the look of my mobile site on several mobile devices on several browsers and was surprised that nothing was working properly (again unlike the verification in the preview). This led to a call with the Wix support team full of several polite holds and confusion - until the culprit was found: wixWindow.formFactor.
In the end, like explained in your API, nothing was backward and logically the formFactor should be set to "Mobile" (in this case within an if-statement) to then proceed with the desired effects within the desired mobile version of the site which can only be seen on a mobile device. But, while doing so, the Wix mobile site preview will not show you the effects one has made with such a procedure because the environment (the Wix mobile editor) in some way is still recognized as desktop-viewed.
Seeing that a desktop is the only way one can access the ability to edit their site/code and that seeing a preview is the most convenient and sometimes only option my fellow WixCoders may have to determine whether their design is working appropriately, I believe this to be a highly important thing to fix. The mobile preview should cater to the users/developers code completely as if in a mobile environment. And for the most part, it does - yet small issues like this can cause mini headaches for advanced-beginner coders and Wix support alike.
I have attached some screenshots, showing you the code with the formFactor set to "Mobile", the results of the Wix mobile editor preview and the real mobile results. Code:
Just to note, in the preview all elements that were supposed to be collapsed on-load weren't and all the buttons weren't responsive. This was a completely different result compared to the success of the real mobile environment test.
Here's the unresponsive preview.
In the real mobile environment (collage):
First picture is how everything was supposed to load, the following two is the correct interaction.
Hopefully, this helped you guys! Hopefully, this will get fixed soon. And please feel free to contact me anytime if there is a need for clarification (or information regarding being able to become a part of the Wix Team - I'm totally interested!)