fix: unable to change color while in wysiwyg

This commit is contained in:
dwelle 2024-06-13 23:58:43 +02:00
parent 4dc4590f24
commit 292a869ee4

View File

@ -562,7 +562,7 @@ export const textWysiwyg = ({
window.removeEventListener("resize", updateWysiwygStyle); window.removeEventListener("resize", updateWysiwygStyle);
window.removeEventListener("wheel", stopEvent, true); window.removeEventListener("wheel", stopEvent, true);
window.removeEventListener("pointerdown", onPointerDown); window.removeEventListener("pointerdown", onPointerDown, { capture: true });
window.removeEventListener("pointerup", bindBlurEvent); window.removeEventListener("pointerup", bindBlurEvent);
window.removeEventListener("blur", handleSubmit); window.removeEventListener("blur", handleSubmit);
window.removeEventListener("beforeunload", handleSubmit); window.removeEventListener("beforeunload", handleSubmit);
@ -644,7 +644,7 @@ export const textWysiwyg = ({
window.addEventListener("blur", handleSubmit); window.addEventListener("blur", handleSubmit);
} else if ( } else if (
event.target instanceof HTMLElement && event.target instanceof HTMLElement &&
!event.target.contains(editable) && event.target.nodeName === "CANVAS" &&
// Vitest simply ignores stopPropagation, capture-mode, or rAF // Vitest simply ignores stopPropagation, capture-mode, or rAF
// so without introducing crazier hacks, nothing we can do // so without introducing crazier hacks, nothing we can do
!isTestEnv() !isTestEnv()