Javascript code to stop the touch movement when a Field is selected in an HTML form

This code can be used to pause the touch movement in mobile devices while entering an input to a field or you can use in canvas field for signature etc.

Code snippet:

//Additional code in the javascript view file
events: {
            'touchstart #in-modal-sig-canvas': 'preventCanvasScroll'
        },
        preventCanvasScroll: function(event){
            event.preventDefault();
        },
//Additional code in the javascript view file

Leave a comment

Your email address will not be published. Required fields are marked *