From 9912b5037db3a152178691dfab43833e595682bf Mon Sep 17 00:00:00 2001 From: jialin Date: Tue, 24 Dec 2024 16:29:09 +0800 Subject: [PATCH] chore: disable editor when loading --- src/components/image-editor/index.tsx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/components/image-editor/index.tsx b/src/components/image-editor/index.tsx index 62eb324f..afb0cf33 100644 --- a/src/components/image-editor/index.tsx +++ b/src/components/image-editor/index.tsx @@ -494,6 +494,14 @@ const CanvasImageEditor: React.FC = ({ }; }, []); + useEffect(() => { + if (disabled) { + overlayCanvasRef.current!.style.pointerEvents = 'none'; + } else { + overlayCanvasRef.current!.style.pointerEvents = 'auto'; + } + }, [disabled]); + return (