fix: phone input update state persistence (#9471)

* fix: phone input update state persistence

* refactor: use spreading

Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>

---------

Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>
Co-authored-by: alannnc <alannnc@gmail.com>
Co-authored-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>
pull/9618/head
Jaideep Guntupalli 2023-06-13 20:24:13 +05:30 committed by GitHub
parent 8623175612
commit 3a352a94f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -57,12 +57,15 @@ const LocationInput = (props: {
<Input {...locationFormMethods.register(eventLocationType.variable)} type="text" {...remainingProps} /> <Input {...locationFormMethods.register(eventLocationType.variable)} type="text" {...remainingProps} />
); );
} else if (eventLocationType?.organizerInputType === "phone") { } else if (eventLocationType?.organizerInputType === "phone") {
const { defaultValue, ...rest } = remainingProps;
return ( return (
<Controller <Controller
name={eventLocationType.variable} name={eventLocationType.variable}
control={control} control={control}
defaultValue={defaultValue}
render={({ field: { onChange, value } }) => { render={({ field: { onChange, value } }) => {
return <PhoneInput onChange={onChange} value={value} {...remainingProps} />; return <PhoneInput onChange={onChange} value={value} {...rest} />;
}} }}
/> />
); );