Skip to content

Commit

Permalink
Merge pull request #28220 from dukenv0307/fix/28034
Browse files Browse the repository at this point in the history
fix: state gets cleared when selecting the same country
  • Loading branch information
arosiclair authored Sep 26, 2023
2 parents 30f675d + fe087f8 commit b013df8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/components/CountryPicker/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ function CountryPicker({value, errorText, onInputChange, forwardedRef}) {
};

const updateCountryInput = (country) => {
onInputChange(country.value);
if (country.value !== value) {
onInputChange(country.value);
}
hidePickerModal();
};

Expand Down
4 changes: 3 additions & 1 deletion src/components/StatePicker/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ function StatePicker({value, errorText, onInputChange, forwardedRef, label}) {
};

const updateStateInput = (state) => {
onInputChange(state.value);
if (state.value !== value) {
onInputChange(state.value);
}
hidePickerModal();
};

Expand Down

0 comments on commit b013df8

Please sign in to comment.