After a user enters data in my application, they are required to sign using the signature-pad plugin found here: https://github.com/szimek/signature_pad. The signature is then placed in a modal created using bootstrap4.
The problem arises when I try to open the modal, as the canvas inside it has dimensions of 0x0 pixels. To fix this issue, I need to resize the screen and initialize the library when the modal is opened.
I have attempted to set the width of the modal-body dynamically, but this did not provide a satisfactory solution. Manually setting the width and height also did not work as expected.
<script>
$('#myModal').on('show.bs.modal', function (e) {
console.log("modal open");
resizeCanvas();
});
</script>