State not updating in mobile device. It does in PC

I have been dealing with this for some time but I would love to find a solution to it. I hope you can help me find a way to achieve it.

Basically the issue is that the state in a screen component is not being updated in a certain situation in a mobile device (iPad or mobile). In my project I have a detail screen where the info for that document has been stored in a couple of dataSlots:

When I click “Play”, it takes me an external resource that I have in the public directory. In that resource I have configured it so it saves the data that I need in three dataSlots, but the important one here is “ds_score” which is the one that should change the state of the detail screen.

In the screenshot the dataSlot “ds_score” is > ‘1%’, that is the condition to show state 1 in detail screen:

So when I click the “Go back” button in the external resource, I have this code placed:

<div><input type='button' class='button' id='back' value='Go back' onclick="history.back()"></div>

When it comes back to the detail screen, it behaves as it should in a PC:

However, it does not in a mobile device and I need to manually refresh the page to show state 1 and not 0.

Is there a solution for this? Thank you in advance.

Hi petoma,

The reason for this maybe that touch devices have different events.
They don’t convert automatically touch events into mouse events.
The events are different even for different brands of touch devices.
Have a look at this:

Hey @Oliver_Burrell,

Thank you so much for your answer. I assumed that it was something like that. So it would be necessary something to fire changing the state. I was reading about the issue and I have seen that a possible solution to this would be to use a function for “focusing the screen”. But I am learning and I don’t know how to inplement this focus function into the Screen component in React Studio. I know I would have to use the Script editor for that screen and write the function there but I don’t know how to create that function or where to place it because I am learning everyday :slight_smile:

Thanks again!

Hi petoma,

You could try to also add to the div ontouchstart=“history.back()” and see if this makes a difference but you are right it could also be the focus of an overlapping element.