From a128b0b5bb0973cdc096d3a2992d309eb9e3b794 Mon Sep 17 00:00:00 2001 From: ysCha Date: Tue, 6 Jan 2026 12:22:57 +0900 Subject: [PATCH] =?UTF-8?q?=EB=B0=A9=EC=9C=84=EA=B0=81=20=EC=A0=9C?= =?UTF-8?q?=ED=95=9C=20(-180=20~=20180)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/common/input/CalcInput.jsx | 6 ++++-- .../floor-plan/modal/basic/step/Orientation.jsx | 11 ++++++++++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/components/common/input/CalcInput.jsx b/src/components/common/input/CalcInput.jsx index 5cb2bb42..b17f6667 100644 --- a/src/components/common/input/CalcInput.jsx +++ b/src/components/common/input/CalcInput.jsx @@ -1,4 +1,4 @@ -import React, { useState, useRef, useEffect, forwardRef } from 'react' +import React, { useState, useRef, useEffect, forwardRef, useImperativeHandle } from 'react' import { createCalculator } from '@/util/calc-utils' import '@/styles/calc.scss' @@ -294,9 +294,11 @@ export const CalculatorInput = forwardRef( } else { calculator.currentOperand = filteredValue setHasOperation(false) + // 연산자가 없는 순수 숫자일 때만 부모 컴포넌트의 onChange 호출 + onChange(filteredValue) } - onChange(filteredValue) + //onChange(filteredValue) } } diff --git a/src/components/floor-plan/modal/basic/step/Orientation.jsx b/src/components/floor-plan/modal/basic/step/Orientation.jsx index 4feeb41b..fe00c93b 100644 --- a/src/components/floor-plan/modal/basic/step/Orientation.jsx +++ b/src/components/floor-plan/modal/basic/step/Orientation.jsx @@ -452,7 +452,16 @@ export const Orientation = forwardRef((props, ref) => { className="input-origin block" value={inputCompasDeg} readOnly={!hasAnglePassivity} - onChange={(value) => setInputCompasDeg(value)} + onChange={(value) => { + // Convert to number and ensure it's within -180 to 180 range + const numValue = parseInt(value, 10); + if (!isNaN(numValue)) { + const clampedValue = Math.min(180, Math.max(-180, numValue)); + setInputCompasDeg(String(clampedValue)); + } else { + setInputCompasDeg(value); + } + }} options={{ allowNegative: true, allowDecimal: false