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