From a258f610931b12486ae758364cfce98fa39a293f Mon Sep 17 00:00:00 2001 From: ysCha Date: Thu, 8 Jan 2026 14:46:21 +0900 Subject: [PATCH 1/3] =?UTF-8?q?=ED=83=AD=ED=82=A4,=20=EB=B0=A9=ED=96=A5?= =?UTF-8?q?=ED=82=A4=20=EA=B3=84=EC=82=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/common/input/CalcInput.jsx | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/components/common/input/CalcInput.jsx b/src/components/common/input/CalcInput.jsx index 37bd00ef..df41043f 100644 --- a/src/components/common/input/CalcInput.jsx +++ b/src/components/common/input/CalcInput.jsx @@ -340,12 +340,18 @@ export const CalculatorInput = forwardRef( // Tab 키는 계산기 숨기고 기본 동작 허용 if (e.key === 'Tab') { + if (hasOperation) { + handleCompute(true) // 계산 수행 + } setShowKeypad(false) return } // 모든 방향키는 기본 동작 허용 if (e.key === 'ArrowLeft' || e.key === 'ArrowRight' || e.key === 'ArrowUp' || e.key === 'ArrowDown') { + if (hasOperation) { + handleCompute(true) // 계산 수행 + } setShowKeypad(true) return } @@ -360,6 +366,12 @@ export const CalculatorInput = forwardRef( return } + // --- 여기서부터는 브라우저의 기본 입력을 막고 계산기 로직만 적용함 --- + if (e.key !== 'Process') { // 한글 입력 등 특수 상황 방지 (필요시) + // e.preventDefault() 호출 위치를 확인하세요. + } + + e.preventDefault() const calculator = calculatorRef.current const { allowDecimal } = options From 9683b38cf0d60c170cfa05bf90f7260fe53214b2 Mon Sep 17 00:00:00 2001 From: ysCha Date: Thu, 8 Jan 2026 15:15:17 +0900 Subject: [PATCH 2/3] =?UTF-8?q?=EB=B0=A9=ED=96=A5=ED=82=A4=EC=97=90=20?= =?UTF-8?q?=EC=88=AB=EC=9E=90=ED=8C=A8=EB=93=9C=20=EC=88=A8=EA=B9=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/common/input/CalcInput.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/common/input/CalcInput.jsx b/src/components/common/input/CalcInput.jsx index df41043f..9cfddfd4 100644 --- a/src/components/common/input/CalcInput.jsx +++ b/src/components/common/input/CalcInput.jsx @@ -352,7 +352,7 @@ export const CalculatorInput = forwardRef( if (hasOperation) { handleCompute(true) // 계산 수행 } - setShowKeypad(true) + setShowKeypad(false) return } From 12f442b3edeec26620ae269a21878a01dc453b0a Mon Sep 17 00:00:00 2001 From: ysCha Date: Thu, 8 Jan 2026 15:17:45 +0900 Subject: [PATCH 3/3] =?UTF-8?q?=EB=B0=98=EC=98=81=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../floor-plan/modal/lineTypes/DoublePitch.jsx | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/components/floor-plan/modal/lineTypes/DoublePitch.jsx b/src/components/floor-plan/modal/lineTypes/DoublePitch.jsx index 12ed66be..4919462b 100644 --- a/src/components/floor-plan/modal/lineTypes/DoublePitch.jsx +++ b/src/components/floor-plan/modal/lineTypes/DoublePitch.jsx @@ -26,17 +26,15 @@ export default function DoublePitch({ props }) { arrow2Ref, } = props - const getLength2 = () => { - const angle1Value = angle1Ref.current.value - const angle2Value = angle2Ref.current.value - const length1Value = length1Ref.current.value + const getLength2 = (angle1, angle2, length1) => { + const angle1Value = angle1 !== undefined ? angle1 : angle1Ref.current?.value + const angle2Value = angle2 !== undefined ? angle2 : angle2Ref.current?.value + const length1Value = length1 !== undefined ? length1 : length1Ref.current?.value const arrow1Value = arrow1Ref.current - const arrow2Value = arrow2Ref.current - if (angle1Value !== 0 && length1Value !== 0 && angle2Value !== 0 && arrow1Value !== '') { + if (!isNaN(Number(angle1Value)) && !isNaN(Number(length1Value)) && !isNaN(Number(angle2Value)) && arrow1Value) { const radian1 = (getDegreeByChon(angle1Value) * Math.PI) / 180 - const radian2 = (getDegreeByChon(angle2Value) * Math.PI) / 180 return Math.floor((Math.tan(radian1) * length1Value) / Math.tan(radian2)) } @@ -178,7 +176,7 @@ export default function DoublePitch({ props }) { ref={angle2Ref} onChange={(value) => { setAngle2(value) - setLength2(getLength2()) + setLength2(getLength2(angle1Ref.current?.value, value, length1Ref.current?.value)) }} placeholder="45" onFocus={() => (angle2Ref.current.value = '')}