[Tokyo Template] Issue with uploading files

[Tokyo Template] Issue with uploading files

  
Forge Component
(14)
Published on 10 May by OutSystems Labs
14 votes
Published on 10 May by OutSystems Labs
Please refer to this discussion:

/**EDITED**/

But quick overview is, on any IOS device using an upload button that calls the Choose File component click event does not work, but it works fine on android devices.

I've attached a simple oml file to show what is happening, sometimes on IOS if you long press the button it will finally work it is weird, outsystems is saying this is only an issue with the Tokyo Theme and to reach out to you guys about it.

Hello Cody,

First off all thank you for the feedback. I edited your post to remove the support link you posted (this information is confidential, and the forums are public).

We will take a closer look into this issue and we will let you know when we have an update.

Best Regards,
Samuel Jesus
Awesome, thank you!
Solution
Hello Cody,
 
After taking a closer look into your issue, here are our findings.
 
The iOS version 8.4.1 introduced some misbehaviours in certain links. In this particular case, it has some security restrictions on click events that have conficts with the opacity and click libraries like FastClick (used in Silk UI).
Looking at your code, the workaround is to call the touchstart event. Here is the corrected code:
 
"$('#"+MyButton.Id+"').on('click touchstart', function() {
    $('#"+UploadFile.Id+"').click();
});"
 
You can use an expression, but we suggest you to use the Silk UI JS pattern to use this code snippet instead of the onclick event on the button:

 
Best Regards,
Samuel Jesus
Solution
I tested this JS Code and it doesn't work. It still only works if you do a longer press on the button, like 1 full second, if you quickly tap the button it doesn't work.
Hello Cody,

We tested this fix on the eSpace you provided earlier, and it worked as expected both on Ipad and Iphone (iOS Version 8.4.1).
Can you please check your code with the attached eSpace ?

Best Regards,
Samuel Jesus
Omg, I'm sorry I implemented your JS Workaround incorrectly, you are correct it does work! Thank you so much for fixing this we will have many happy end users now, thanks again!