From a258f610931b12486ae758364cfce98fa39a293f Mon Sep 17 00:00:00 2001 From: ysCha Date: Thu, 8 Jan 2026 14:46:21 +0900 Subject: [PATCH] =?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