Skip to content

Commit dbab026

Browse files
author
Gianmarco Manni
committed
x
1 parent 3e27dd3 commit dbab026

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

src/lib/components/TelephoneNumberInput/TelephoneNumberAutocomplete.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,17 +50,16 @@ const TelephoneNumberAutocomplete = <T extends FieldValues>(props: TelephoneNumb
5050
onInputChange={(_, _value, reason) => {
5151
if (reason === "clear") {
5252
setIsOpen(true);
53-
return;
5453
}
5554
}}
5655
onChange={(_, value, reason) => {
57-
// cannot be cleared
58-
if (value === null) {
56+
if (reason === "clear") {
57+
setIsOpen(true);
5958
return;
6059
}
6160

62-
if (reason === "clear") {
63-
setIsOpen(true);
61+
// cannot be cleared
62+
if (value === null) {
6463
return;
6564
}
6665

0 commit comments

Comments
 (0)