From d2d6610a9ecf239d7c2c6ce8f7c8c642b81817c6 Mon Sep 17 00:00:00 2001 From: "hyojun.choi" Date: Tue, 5 Nov 2024 15:51:39 +0900 Subject: [PATCH] =?UTF-8?q?=EC=84=A0=ED=83=9D=EB=90=9C=20object=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD=20=EC=8B=9C=20ref=20=EC=B4=88=EA=B8=B0?= =?UTF-8?q?=ED=99=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/roofcover/useMovementSetting.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/hooks/roofcover/useMovementSetting.js b/src/hooks/roofcover/useMovementSetting.js index 1c128133..fdde7314 100644 --- a/src/hooks/roofcover/useMovementSetting.js +++ b/src/hooks/roofcover/useMovementSetting.js @@ -74,6 +74,7 @@ export function useMovementSetting(id) { outerLines.forEach((line) => { line.set({ stroke: 'black' }) }) + clearRef() if (!currentObject) { return } @@ -85,6 +86,21 @@ export function useMovementSetting(id) { canvas.renderAll() }, [currentObject]) + const clearRef = () => { + if (type === TYPE.FLOW_LINE) { + FLOW_LINE_REF.DOWN_LEFT_INPUT_REF.current.value = '' + FLOW_LINE_REF.UP_RIGHT_INPUT_REF.current.value = '' + FLOW_LINE_REF.DOWN_LEFT_RADIO_REF.current.checked = false + FLOW_LINE_REF.UP_RIGHT_RADIO_REF.current.checked = false + } + if (type === TYPE.UP_DOWN) { + UP_DOWN_REF.UP_INPUT_REF.current.value = '' + UP_DOWN_REF.DOWN_INPUT_REF.current.value = '' + UP_DOWN_REF.UP_RADIO_REF.current.checked = false + UP_DOWN_REF.DOWN_RADIO_REF.current.checked = false + } + } + const mouseMoveEvent = (e) => { if (typeRef.current === TYPE.FLOW_LINE) { flowLineEvent(e)