feat: Add autofocus on write form

This commit is contained in:
jhynsoo 2023-10-25 18:40:00 +09:00
parent 23738335df
commit 9280d9b710
3 changed files with 4 additions and 1 deletions

View File

@ -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}
/>
</S.CurrencyInput>
);

View File

@ -11,6 +11,7 @@ function PriceStep({ gotoNextStep, gotoPrevStep, price, setPrice }) {
<CurrencyInput
value={price}
setValue={setPrice}
autofocus
/>
<ButtonArea>
<Button

View File

@ -18,6 +18,7 @@ function TextStep({ text, setText, gotoNextStep, gotoPrevStep }) {
value={text}
onChange={handleChange}
$height={height}
autoFocus
/>
<ButtonArea>
<Button