From 0761f2bdeae81bf5b84ecd57368879c40f4c4348 Mon Sep 17 00:00:00 2001 From: Abhinav Date: Mon, 20 Jun 2022 15:19:57 +0530 Subject: [PATCH] fix collection reanme value pre filled with existing name --- src/components/Collections/CollectionNamer.tsx | 1 + src/components/SingleInputForm.tsx | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/Collections/CollectionNamer.tsx b/src/components/Collections/CollectionNamer.tsx index 46c5d9d65..9ab82c946 100644 --- a/src/components/Collections/CollectionNamer.tsx +++ b/src/components/Collections/CollectionNamer.tsx @@ -50,6 +50,7 @@ export default function CollectionNamer({ attributes, ...props }: Props) { fieldType="text" buttonText={attributes.buttonText} placeholder={constants.ENTER_ALBUM_NAME} + initialValue={attributes.autoFilledName} /> ); diff --git a/src/components/SingleInputForm.tsx b/src/components/SingleInputForm.tsx index 37b6f313f..dc66bd746 100644 --- a/src/components/SingleInputForm.tsx +++ b/src/components/SingleInputForm.tsx @@ -19,6 +19,7 @@ export interface SingleInputFormProps { placeholder: string; buttonText: string; customSubmitButton?: any; + initialValue?: string; } export default function SingleInputForm(props: SingleInputFormProps) { @@ -67,7 +68,7 @@ export default function SingleInputForm(props: SingleInputFormProps) { return ( - initialValues={{ inputValue: '' }} + initialValues={{ inputValue: props.initialValue ?? '' }} onSubmit={submitForm} validationSchema={validationSchema} validateOnChange={false}