1
0
Fork 0
mirror of https://github.com/immich-app/immich.git synced 2024-12-28 22:51:59 +00:00

fix(mobile): Reset dropdown values in search by location on mobile (#9261)

* set derived inputs as null if source input changes

* format

---------

Co-authored-by: Tushar Harsora <tushar.harsora.harsora@oracle.com>
Co-authored-by: Alex Tran <alex.tran1502@gmail.com>
This commit is contained in:
Tushar Harsora 2024-05-05 04:14:34 +05:30 committed by GitHub
parent dc4f7bef69
commit c18beddef8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -87,11 +87,16 @@ class LocationPicker extends HookConsumerWidget {
trailingIcon: const Icon(Icons.arrow_drop_down_rounded),
selectedTrailingIcon: const Icon(Icons.arrow_drop_up_rounded),
onSelected: (value) {
if (value.toString() == selectedCountry.value) {
return;
}
selectedCountry.value = value.toString();
stateTextController.value = TextEditingValue.empty;
cityTextController.value = TextEditingValue.empty;
onSelected({
'country': selectedCountry.value,
'state': selectedState.value,
'city': selectedCity.value,
'state': null,
'city': null,
});
},
),
@ -120,11 +125,15 @@ class LocationPicker extends HookConsumerWidget {
trailingIcon: const Icon(Icons.arrow_drop_down_rounded),
selectedTrailingIcon: const Icon(Icons.arrow_drop_up_rounded),
onSelected: (value) {
if (value.toString() == selectedState.value) {
return;
}
selectedState.value = value.toString();
cityTextController.value = TextEditingValue.empty;
onSelected({
'country': selectedCountry.value,
'state': selectedState.value,
'city': selectedCity.value,
'city': null,
});
},
),