Signature-pad goes beyond the screen


#1

I wonder how I can set the size of the signature-pad so it fits the screen properly…
The with is fine, but the height is too long. I have tried to set it to window.innerHeight and canvas.offsetHeight, but it’s still too long… (Phone in landscape-mode)
This is how I set the canvas now:

canvasResize() {
        let canvas = document.querySelector('canvas');
        canvas.width = window.innerWidth;
        canvas.height = canvas.clientHeight;
        this.signaturePad.clear();
    }

Thanks for answers


#2

A link to the plugin / library you are using might be helpful.


#3

Linkt to plugin: https://github.com/szimek/signature_pad
Found a solution that works fine, but I gues it’s not the best way to do it: Prevent the user from scrolling down the signature pad.