Mobile code doesn't work as intented :c

Hi,

I’ve put this and it seems to work when we “click” in mobile, but it works like one in two. When I come back to the page, one button doesn’t work anymore and when I try the other one and come back it works again but the other button doesn’t work :C

Desktop version is 100% functionnal.

I’m new with this code, did I make a mistake ?

Thank you in advance
Melvin A.

import wixLocation from 'wix-location';

export function iconButton59_mouseIn(event) {
    $w("#image181").show();
    wixLocation.to("/page1")
}

export function button67_mouseIn(event) {
 //Add your code for this event here: 
    $w("#image181").show();
    wixLocation.to("/page2")
}

export function button119_mouseIn(event) {
    $w("#image181").show();
    wixLocation.to("/page3")
}

export function button131_mouseIn(event) {
    $w("#image181").show();
    wixLocation.to("/page4")
}

Hey!

The code you provided is with the mouseIn event which is not expected to work consistently on mobile (since there is no way to track the ‘mouse’).

You should have a separate section for desktop code and mobile code. You can do so by checking the form factor:
https://www.wix.com/corvid/reference/wix-window.html#formFactor
Then you will be able to set it up with the mouse in on the desktop and with the click on mobile properly.
https://support.wix.com/en/article/corvid-tutorial-displaying-elements-in-mobile-only

If you still can not figure it out - maybe there is a problem with the layout and your button can not be clicked properly.
You can open the ticket for Wix Support about this issue and we will be able to check it in the Editor:
https://support.wix.com/en/article/contacting-wix-support