Closed zeke closed 1 year ago
I would love help from the community on this one!
It seems that this is the problem with a mask. I'm not familiar with react, nor with that one lib, but digging briefly through the code, it seems that the mask is used with eraser function.
Since you don't have an erasing element on your canvas, but "Undo" button instead, you could remove mask
attribute from #react-sketch-canvas
element to show whole canvas without that mask. For me it solves the problem on Firefox.
https://user-images.githubusercontent.com/4781532/222332276-d34b3261-5baf-46d4-9da2-c4f49d9f0481.mp4
This Greasemonkey script serves as a workaround on a client's side, but if added serverside, it can temporary solve the problem till the full-fledged fix :P
// ==UserScript==
// @name scribblediffusion canvas temp fix
// @description Removes mask attr from canvas element for proper view in firefox
// @match https://scribblediffusion.com/
// @version 1.0.0
// ==/UserScript==
window.addEventListener('load', function () {
var canvas_with_mask = document.querySelector("#react-sketch-canvas__stroke-group-0");
canvas_with_mask.removeAttribute("mask");
})
I can verify that the script @scsmash3r gave fixes the issue.
Nice work! Thanks for your help on this.
The existing
react-sketch-canvas
package that's currently used has a number of issues:There are probably a lot of alternative npm packages out there that do the same thing, but better. Here are some that might be useful: