From 3e911972391bbcb441746b9d21d2c5db279ca268 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?sanguu516=28=EB=B0=95=EC=83=81=ED=98=84=29?= Date: Wed, 27 Sep 2023 09:57:42 +0900 Subject: [PATCH] =?UTF-8?q?=EB=B9=84=ED=96=89=20=EA=B5=AC=EC=97=AD=20m=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../basis/flight/models/basisFlightModel.ts | 2 +- src/views/laanc/LaancStep1.js | 35 +++++++++++++++---- 2 files changed, 30 insertions(+), 7 deletions(-) diff --git a/src/modules/basis/flight/models/basisFlightModel.ts b/src/modules/basis/flight/models/basisFlightModel.ts index 09d2e1d1..d420d009 100644 --- a/src/modules/basis/flight/models/basisFlightModel.ts +++ b/src/modules/basis/flight/models/basisFlightModel.ts @@ -512,7 +512,7 @@ export const initFlightBas = { areaType: '', fltMethod: '', bufferZone: 0, - fltElev: '', + fltElev: '0', createUserId: '', createDt: '', updateUserId: '', diff --git a/src/views/laanc/LaancStep1.js b/src/views/laanc/LaancStep1.js index 103fc09e..ac6089c5 100644 --- a/src/views/laanc/LaancStep1.js +++ b/src/views/laanc/LaancStep1.js @@ -1,4 +1,4 @@ -import React, { useEffect, useState } from 'react'; +import React, { useEffect, useState, useRef } from 'react'; import { useHistory, useLocation } from 'react-router-dom'; import { Search } from 'react-feather'; import { BiBuildings, BiGridAlt } from 'react-icons/bi'; @@ -47,7 +47,8 @@ export default function LaancStep1({ const { user } = useSelector(state => state.authState); const history = useHistory(); - + const fltElevRef = useRef(null); + const bufferZoneRef = useRef(null); const location = useLocation(); const queryParams = new URLSearchParams(location.search); const mapParam = queryParams.get('map'); @@ -57,7 +58,24 @@ export default function LaancStep1({ if (!currentParm) setCenteredModal(mapParam); }, [location]); - // console.log('>', data); + // const handleInputClick = () => { + // // Input 요소가 포커스될 때 커서를 맨 뒤로 이동 + // if (fltElevRef.current) { + // const input = fltElevRef.current; + + // const inputValue = input.value; + // input.setSelectionRange(inputValue.length - 1, inputValue.length - 1); + // input.focus(); + // } + // if (bufferZoneRef.current) { + // const input = bufferZoneRef.current; + + // const inputValue = input.value; + // input.setSelectionRange(inputValue.length - 1, inputValue.length - 1); + // input.focus(); + // } + // }; + return ( <> @@ -234,7 +252,7 @@ export default function LaancStep1({ id='fltElev' name='fltElev' // defaultValue={data.email || ''} - value={data.areaList[0].fltElev} + value={data.areaList[0].fltElev + 'm'} size='sm' onChange={e => { const { name, value } = e.target; @@ -244,6 +262,8 @@ export default function LaancStep1({ value }); }} + // innerRef={fltElevRef} // Input 요소에 ref를 연결 + // onClick={handleInputClick} // innerRef={data} placeholder='100m' /> @@ -259,7 +279,7 @@ export default function LaancStep1({ id='bufferZone' name='bufferZone' // defaultValue={data.email || ''} - value={data.areaList[0].bufferZone} + value={data.areaList[0].bufferZone + 'm'} size='sm' onChange={e => { const { name, value } = e.target; @@ -269,6 +289,8 @@ export default function LaancStep1({ value }); }} + // innerRef={bufferZoneRef} // Input 요소에 ref를 연결 + // onClick={handleInputClick} // innerRef={data} placeholder='100m' /> @@ -458,7 +480,8 @@ export default function LaancStep1({