From 9280d9b710afbc871e6682ffa6cf762867d18941 Mon Sep 17 00:00:00 2001 From: jhynsoo Date: Wed, 25 Oct 2023 18:40:00 +0900 Subject: [PATCH] feat: Add autofocus on write form --- src/components/CurrencyInput/index.jsx | 3 ++- src/pages/WriteSteps/PriceStep.jsx | 1 + src/pages/WriteSteps/TextStep.jsx | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/CurrencyInput/index.jsx b/src/components/CurrencyInput/index.jsx index adcfcdf..94f5697 100644 --- a/src/components/CurrencyInput/index.jsx +++ b/src/components/CurrencyInput/index.jsx @@ -1,6 +1,6 @@ import * as S from '../../styles/CurrencyInput.styles'; -function CurrencyInput({ value, setValue }) { +function CurrencyInput({ value, setValue, autofocus }) { const getRenderValue = () => { if (value === '') { return ''; @@ -28,6 +28,7 @@ function CurrencyInput({ value, setValue }) { value={getRenderValue()} onChange={handleOnChange} placeholder="가격을 입력해주세요" + autoFocus={autofocus} /> ); diff --git a/src/pages/WriteSteps/PriceStep.jsx b/src/pages/WriteSteps/PriceStep.jsx index 79c4e4a..1d71c91 100644 --- a/src/pages/WriteSteps/PriceStep.jsx +++ b/src/pages/WriteSteps/PriceStep.jsx @@ -11,6 +11,7 @@ function PriceStep({ gotoNextStep, gotoPrevStep, price, setPrice }) {