thread-pond / signature-pad

A jQuery plugin for assisting in the creation of an HTML5 canvas based signature pad. Records the drawn signature in JSON for later regeneration.
BSD 3-Clause "New" or "Revised" License
727 stars 292 forks source link

Signature pad is not working in samsung note 3 neo and moto e. #132

Closed ramRkanna closed 9 years ago

ramRkanna commented 9 years ago

Hi I am using the signature pad.I am using jquery version 2.1.1 and Jquery mobile version 1.4.5.

In desktop it is working fine.

But in Samsung note 3 neo the pad is coming like below.

black_screen

And moto e if i am clicking Type tab also it is enabling the signature.

Can i use jquery 2.1.1 version with Signature pad.

Please give me a solution for this.

Thanks.

thomasjbradley commented 9 years ago

Hi I am using the signature pad.I am using jquery version 2.1.1 and Jquery mobile version 1.4.5. In desktop it is working fine.

I know that some people have had weird issues happen with jQuery Mobile, but I don't know how to get around them.

Can i use jquery 2.1.1 version with Signature pad.

As far as I know you can use it with 2.1.1, but I haven't tested it directly. As long as you aren't getting any errors it should be fine.

I expect the problems are coming from jQuery Mobile.

ramRkanna commented 9 years ago

Thanks for the response. But signature pad working fine in desktop browsers.

I am also thinking it may be jquery mobile issue for the first issue.

But for second issue i have checked demo url of signature pad without jquery mobile the same issue occured.

ramRkanna commented 9 years ago

I have added a line in between while disabling the canvas it was missed.After adding it working.The fix is for second issue.For android chrome browser.

function disableCanvas() {

            eventsBound = false

            canvas.each(function () {
                if (this.removeEventListener) {
                    this.removeEventListener('touchend', stopDrawingWrapper)
                    this.removeEventListener('touchcancel', stopDrawingWrapper)
                    this.removeEventListener('touchmove', drawLine)
                   ////This below line missed I have added now it is working. 
                     this.removeEventListener('touchmove', onMouseMove)
                    //                     this.removeEventListener('MSPointerUp', stopDrawingWrapper)
                    //                     this.removeEventListener('MSPointerCancel', stopDrawingWrapper)
                    //                     this.removeEventListener('MSPointerMove', drawLine)
                }

                if (this.ontouchstart)
                    this.ontouchstart = null;
            })

            $(document).unbind('mouseup.signaturepad')
            canvas.unbind('mousedown.signaturepad')
            canvas.unbind('mousemove.signaturepad')
            canvas.unbind('mouseleave.signaturepad')

            $(settings.clear, context).unbind('click.signaturepad')
        }
ramRkanna commented 9 years ago

The black screen issue occurred because the height of the canvas we given wrongly.There is no problem with signature pad code.

But second issue in chrome browser it is appearing with the signature pad demo site itself.so please update the code.

Thanks, Ram.

thomasjbradley commented 9 years ago

@ramRkanna Could you submit a pull request with the new line of code you added above?

ramRkanna commented 9 years ago

@thomasjbradley yes i will do.And one more thing inside the initDrawEvents function

$('input').blur();

the above code making slow down the signature pad in single page application.Is it using for any thing major.

thomasjbradley commented 9 years ago

I can't remember specifically why that would be there. If it's causing problems and it works okay without it, then I don't see why it can't be removed.

ramRkanna commented 9 years ago

I am going to remove that code too.