Compare commits
No commits in common. "4133f1b51216e081987ba19aeb4657e6d61ffd8b" and "d59e64c5bb0c62dfc13510b2c228d29b4f788045" have entirely different histories.
4133f1b512
...
d59e64c5bb
@ -63,33 +63,6 @@ export const CalculatorInput = forwardRef(
|
|||||||
const calculator = calculatorRef.current
|
const calculator = calculatorRef.current
|
||||||
let newDisplayValue = ''
|
let newDisplayValue = ''
|
||||||
|
|
||||||
// 블록 지정(Selection) 확인 및 처리
|
|
||||||
if (inputRef.current) {
|
|
||||||
const { selectionStart, selectionEnd } = inputRef.current
|
|
||||||
// 텍스트 전체 또는 일부가 블록 지정된 경우
|
|
||||||
if (selectionStart !== null && selectionEnd !== null && selectionStart !== selectionEnd) {
|
|
||||||
// 연산 중이 아닐 때만 전체 초기화 후 입력 처리 (계산기 모드 유지를 위해)
|
|
||||||
if (!hasOperation) {
|
|
||||||
calculator.currentOperand = num.toString()
|
|
||||||
calculator.previousOperand = ''
|
|
||||||
calculator.operation = undefined
|
|
||||||
calculator.shouldResetDisplay = false
|
|
||||||
|
|
||||||
newDisplayValue = calculator.currentOperand
|
|
||||||
setDisplayValue(newDisplayValue)
|
|
||||||
onChange(newDisplayValue)
|
|
||||||
|
|
||||||
requestAnimationFrame(() => {
|
|
||||||
if (inputRef.current) {
|
|
||||||
inputRef.current.focus()
|
|
||||||
inputRef.current.setSelectionRange(newDisplayValue.length, newDisplayValue.length)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
return // 블록 처리 로직 완료 후 종료
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// maxLength 체크
|
// maxLength 체크
|
||||||
if (maxLength > 0) {
|
if (maxLength > 0) {
|
||||||
const currentLength = (calculator.currentOperand || '').length + (calculator.previousOperand || '').length + (calculator.operation || '').length
|
const currentLength = (calculator.currentOperand || '').length + (calculator.previousOperand || '').length + (calculator.operation || '').length
|
||||||
|
|||||||
@ -2039,11 +2039,7 @@ export default function Estimate({}) {
|
|||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
menuPlacement={'auto'}
|
menuPlacement={'auto'}
|
||||||
getOptionLabel={(x) => {
|
getOptionLabel={(x) => x.itemName + ' (' + x.itemNo + ')'}
|
||||||
// 메뉴 리스트에 보이는 텍스트 디코딩
|
|
||||||
const doc = new DOMParser().parseFromString(x.itemName, 'text/html');
|
|
||||||
return (doc.documentElement.textContent || x.itemName) + ' (' + x.itemNo + ')';
|
|
||||||
}}
|
|
||||||
getOptionValue={(x) => x.itemNo}
|
getOptionValue={(x) => x.itemNo}
|
||||||
components={{
|
components={{
|
||||||
SingleValue: ({ children, ...props }) => {
|
SingleValue: ({ children, ...props }) => {
|
||||||
@ -2052,21 +2048,13 @@ export default function Estimate({}) {
|
|||||||
}}
|
}}
|
||||||
isClearable={false}
|
isClearable={false}
|
||||||
isDisabled={!!item?.paDispOrder}
|
isDisabled={!!item?.paDispOrder}
|
||||||
value={(() => {
|
value={displayItemList.filter(function (option) {
|
||||||
const selectedOption = displayItemList.find((option) => {
|
if (item.itemNo === '') {
|
||||||
return item.itemNo !== '' && option.itemId === item.itemId;
|
return false
|
||||||
});
|
} else {
|
||||||
|
return option.itemId === item.itemId
|
||||||
if (selectedOption) {
|
|
||||||
// 현재 선택된 값의 itemName을 실시간으로 디코딩하여 전달
|
|
||||||
const doc = new DOMParser().parseFromString(selectedOption.itemName, 'text/html');
|
|
||||||
return {
|
|
||||||
...selectedOption,
|
|
||||||
itemName: doc.documentElement.textContent || selectedOption.itemName
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
return null;
|
})}
|
||||||
})()}
|
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
<Select
|
<Select
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user