You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 1, 2022. It is now read-only.
In my scenario I unmount the CanvasDraw when `window.innerWidth < 992` which resulted in the following error:
```
index.js:445 Uncaught DOMException: Failed to execute 'drawImage' on 'CanvasRenderingContext2D': The image argument is a canvas element with a width or height of 0.
at _default._this.saveLine (http://localhost:3000/static/js/22.chunk.js:533:25)
at http://localhost:3000/static/js/22.chunk.js:311:17
```
Those are lines
`408: this.ctx.drawing.drawImage(this.canvas.temp, 0, 0, width, height);`
and
`241: this.saveLine({ brushColor, brushRadius });`
I figured out that `saveLine` was called from `simulateDrawingLines`, from the `loadSaveData` from the `handleCanvasResize`. Which fired at the same moment, when the component actually got unmounted. The simplest solution is to properly unobserve the `ResizeObserver`, which this PR does.
0 commit comments