length1Ref current가 없을 경우는 실행하지 않는다

This commit is contained in:
hyojun.choi 2025-03-05 14:16:19 +09:00
parent 6b3d0ea6ff
commit eb928fc4f2

View File

@ -688,8 +688,9 @@ export function usePlacementShapeDrawing(id) {
} }
// 포커스가 length1에 있지 않으면 length1에 포커스를 줌 // 포커스가 length1에 있지 않으면 length1에 포커스를 줌
const activeElem = document.activeElement const activeElem = document.activeElement
if (activeElem !== length1Ref.current) { if (activeElem !== length1Ref.current) {
length1Ref.current.focus() length1Ref.current?.focus()
} }
const key = e.key const key = e.key
@ -698,7 +699,7 @@ export function usePlacementShapeDrawing(id) {
return return
} }
const lengthNum = Number(length1Ref.current.value) / 10 const lengthNum = Number(length1Ref.current?.value) / 10
if (lengthNum === 0) { if (lengthNum === 0) {
return return
} }