I am facing an issue with placing multiple signature pads inside table cells.
Only the first canvas gets drawn, while the others remain blank. I have checked the mouse/touch events. The events are triggered (up/down/move) and the draw function is called, but the canvas does not get drawn.
On using toDataURL, the result is just a white image.
The canvas outside the table works perfectly fine and gets drawn as expected.
I have searched for documentation on this issue but couldn't find any. Any help would be appreciated.
Here is the code snippet:
// This is the draw function
const init = function (el) {
let context = el.getContext("2d");
context.strokeStyle = "#df4b26";
context.lineJoin = "round";
context.lineWidth = 2;
let offset = {
left: el.offsetLeft,
top: el.offsetTop,
}
let down = false
let points = []
// Rest of the code for event handlers and Vue component
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.17/vue.js"></script>
<div id="app">
<table>
<tr>
<td>
<signature :width="200" :height="200"></signature>
</td>
<td>
<signature :width="200" :height="200"></signature>
</td>
<td>
<signature :width="200" :height="200"></signature>
</td>
</tr>
<tr>
<td>
<signature :width="200" :height="200"></signature>
</td>
<td>
<signature :width="200" :height="200"></signature>
</td>
<td>
<signature :width="200" :height="200"></signature>
</td>
</tr>
</table>
<signature :width="200" :height="200"></signature>
<signature :width="200" :height="200"></signature>
</div>