외벽선 그리기 input foucs시 초기화 추가

This commit is contained in:
hyojun.choi 2024-10-30 11:38:11 +09:00
parent f56906cac1
commit 2ca8b84f17
6 changed files with 17 additions and 1 deletions

View File

@ -19,6 +19,7 @@ export default function Angle({ props }) {
className="input-origin block"
value={angle1}
ref={angle1Ref}
onFocus={(e) => (angle1Ref.current.value = '')}
onChange={(e) => onlyNumberWithDotInputChange(e, setAngle1)}
placeholder="45"
/>
@ -38,6 +39,7 @@ export default function Angle({ props }) {
className="input-origin block"
value={length1}
ref={length1Ref}
onFocus={(e) => (length1Ref.current.value = '')}
onChange={(e) => onlyNumberInputChange(e, setLength1)}
placeholder="3000"
/>

View File

@ -35,6 +35,7 @@ export default function Diagonal({ props }) {
className="input-origin block"
value={outerLineDiagonalLength}
ref={outerLineDiagonalLengthRef}
onFocus={(e) => (outerLineDiagonalLengthRef.current.value = '')}
onChange={(e) => onlyNumberInputChange(e, setOuterLineDiagonalLength)}
placeholder="3000"
/>
@ -56,6 +57,7 @@ export default function Diagonal({ props }) {
className="input-origin block"
value={length1}
ref={length1Ref}
onFocus={(e) => (length1Ref.current.value = '')}
onChange={(e) => onlyNumberInputChange(e, setLength1)}
placeholder="3000"
/>

View File

@ -55,6 +55,7 @@ export default function DoublePitch({ props }) {
className="input-origin block"
value={angle1}
ref={angle1Ref}
onFocus={(e) => (angle1Ref.current.value = '')}
onChange={(e) => onlyNumberWithDotInputChange(e, setAngle1)}
placeholder="45"
/>
@ -71,6 +72,7 @@ export default function DoublePitch({ props }) {
className="input-origin block"
value={length1}
ref={length1Ref}
onFocus={(e) => (length1Ref.current.value = '')}
onChange={(e) => onlyNumberInputChange(e, setLength1)}
placeholder="3000"
/>
@ -128,9 +130,9 @@ export default function DoublePitch({ props }) {
className="input-origin block"
value={angle2}
ref={angle2Ref}
onFocus={(e) => (angle2Ref.current.value = '')}
onChange={(e) => {
onlyNumberWithDotInputChange(e, setAngle2)
console.log(getLength2())
setLength2(getLength2())
}}
placeholder="45"
@ -153,6 +155,7 @@ export default function DoublePitch({ props }) {
className="input-origin block"
value={length2}
ref={length2Ref}
onFocus={(e) => (length2Ref.current.value = '')}
onChange={(e) => onlyNumberInputChange(e, setLength2)}
readOnly={true}
placeholder="3000"

View File

@ -18,6 +18,7 @@ export default function OuterLineWall({ props }) {
className="input-origin block"
value={length1}
ref={length1Ref}
onFocus={(e) => (length1Ref.current.value = '')}
onChange={(e) => onlyNumberInputChange(e, setLength1)}
placeholder="3000"
/>

View File

@ -15,6 +15,7 @@ export default function RightAngle({ props }) {
className="input-origin block"
value={length1}
ref={length1Ref}
onFocus={(e) => (length1Ref.current.value = '')}
onChange={(e) => onlyNumberInputChange(e, setLength1)}
placeholder="3000"
/>
@ -70,6 +71,7 @@ export default function RightAngle({ props }) {
className="input-origin block"
value={length2}
ref={length2Ref}
onFocus={(e) => (length2Ref.current.value = '')}
onChange={(e) => onlyNumberInputChange(e, setLength2)}
placeholder="3000"
/>

View File

@ -115,6 +115,12 @@ export function useOuterLineWall(id, propertiesId) {
setAngle2(0)
setOuterLineDiagonalLength(0)
const activeElem = document.activeElement
if (activeElem) {
activeElem.blur()
}
}
const mouseDown = (e) => {