Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple Canvas Eraser Problem #177

Open
NajmusSakibRashid opened this issue Sep 24, 2024 · 2 comments
Open

Multiple Canvas Eraser Problem #177

NajmusSakibRashid opened this issue Sep 24, 2024 · 2 comments

Comments

@NajmusSakibRashid
Copy link

Describe the bug
The bug is observed when there is multiple canvases in a page. I can draw independently on the canvases but while erasing on a canvas the same event is happened to all other canvases.

To Reproduce
Steps to reproduce the behavior:

  1. Add multiple canvas in a page
  2. Draw something independently to all the canvases
  3. Try to erase in one canvas
  4. You will notice all the drawings of other canvases is also erasing.

Expected behavior
It is expected that only the image I select to erase will perform the erasing operation.

Screenshots
canvas_issue.webm

Desktop (please complete the following information):

  • Linux
  • Chrome
  • Version 128.0.6613.119 (Official Build) (64-bit)

Smartphone (please complete the following information):

  • I did not test it for smartphone.
@Douglas-Hsieh
Copy link

I found another bug that might be related. When you have multiple canvases that use the backgroundImage prop, the canvases will use the background image of the first canvas.

@Louis116
Copy link

would you mind set up a CodeSandBox / CodePen / StackBlitz to reproduce this problem?
By any chances you guys are using the same ref of ReactSketchCanvasRef for all canvas instead of one ref per each canvas?
I think sharing the same ref have potential of causing these bug.
I have tried multiple canvas in same page, but so far not yet encounter both earsier and same background image issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants