I am not able to listen to touch start touch end event.

Hi All, I have written custom javascript in custom.js. I am registering a touchstart handler. But it is not working in Android. I have not tested in iPhone though.  What can be the reason? This is the code(not refactored) document.addEventListener('touchend',function(evt){     if(document.getElementsByClassName("mx-scrollcontainer-open").length && !$(evt.target).closest(".region-sidebar").length && !$(evt.target).closest(".toggle-btn").length){           document.getElementsByClassName("toggle-btn")[0].click();     }     if($(evt.target).closest(".menubtnrow").length || $(evt.target).closest(".mx-templategrid-row")){           $($(evt.target).find("span")[0]).click();     } });
1 answers

All right. So now I know the issue. I was testing the app using mendix app(QR code). I had added custom.js file and it was not getting loaded there. When I tried in chrome browser in mobile, it worked because it was just another web app. To solve the problem I moved my code to JavaScript widget snippet. And it worked!