Skip to content

Commit

Permalink
Merge pull request #52 from prsevero/main
Browse files Browse the repository at this point in the history
fix: input location getting old country value.
  • Loading branch information
hasanharman authored Dec 30, 2024
2 parents 74f7754 + cee7de0 commit 55eb383
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 @@ -369,7 +369,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 55eb383

Please sign in to comment.