Open hey0wing opened 4 years ago
Try this code: `
`
I can confirm that v-show
is blocking signature pad from being editable or usable for that matter.
I didn't get any console errors, it was just not working.
I had this piece of code:
<div v-show="signatureControlsActive == true" class="signatureWrapper">
<div v-show="signaturePadVisible == true">
<div>
<VueSignaturePad
id="signature"
ref="signaturePad"
width="100%"
height="180px"
:options="options" />
</div>
</div>
<div v-show="signatureTextVisible == true"></div>
<h3>Text</h3>
</div>
</div>
And replacing v-show
with v-if
like so:
<div v-if="signatureControlsActive == true" class="signatureWrapper">
<div v-if="signaturePadVisible == true">
<div>
<VueSignaturePad
id="signature"
ref="signaturePad"
width="100%"
height="180px"
:options="options" />
</div>
</div>
<div v-show="signatureTextVisible == true"></div>
<h3>Text</h3>
</div>
</div>
Fixed it for me.
Changing the :key
also works
when you open the page with the new/different signature pad try running this, it must happen after the canvas is visible and has a fixed size
setTimeout(()=>{
this.$refs.
Hi, any updates? I has the same problem
I found solution here
<VueSignaturePad height="300px" width="100%" ref="signaturePad" id="signaturePad" :options="{ onEnd, onBegin: () => { signaturePad.resizeCanvas() } }" />
event onBegin:
` onBegin: () => {
signaturePad.resizeCanvas()
}`
I had some pages with Navbar using v-show, and with SignaturePad in every page.