탭키, 방향키 계산

This commit is contained in:
ysCha 2026-01-08 14:46:21 +09:00
parent 4651ebc365
commit a258f61093

View File

@ -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