Skip to content

Commit

Permalink
fix: input location getting old country value.
Browse files Browse the repository at this point in the history
  • Loading branch information
prsevero committed Dec 10, 2024
1 parent 53cd52b commit cee7de0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion screens/generate-code-field/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ export const generateCodeSnippet = (field: FormFieldType) => {
}}
onStateChange={(state) => {
setStateName(state?.name || '')
form.setValue(field.name, [countryName || '', state?.name || ''])
form.setValue(field.name, [form.getValues(field.name)[0] || '', state?.name || ''])
}}
/>
</FormControl>
Expand Down
2 changes: 1 addition & 1 deletion screens/render-form-field/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ export const renderFormField = (field: FormFieldType, form: any) => {
}}
onStateChange={(state) => {
setStateName(state?.name || '')
form.setValue(field.name, [countryName || '', state?.name || ''])
form.setValue(field.name, [form.getValues(field.name)[0] || '', state?.name || ''])
}}
/>
<FormDescription>{field.description}</FormDescription>
Expand Down

0 comments on commit cee7de0

Please sign in to comment.