1
0
mirror of https://github.com/immich-app/immich.git synced 2024-11-30 09:47:31 +02: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), trailingIcon: const Icon(Icons.arrow_drop_down_rounded),
selectedTrailingIcon: const Icon(Icons.arrow_drop_up_rounded), selectedTrailingIcon: const Icon(Icons.arrow_drop_up_rounded),
onSelected: (value) { onSelected: (value) {
if (value.toString() == selectedCountry.value) {
return;
}
selectedCountry.value = value.toString(); selectedCountry.value = value.toString();
stateTextController.value = TextEditingValue.empty;
cityTextController.value = TextEditingValue.empty;
onSelected({ onSelected({
'country': selectedCountry.value, 'country': selectedCountry.value,
'state': selectedState.value, 'state': null,
'city': selectedCity.value, 'city': null,
}); });
}, },
), ),
@ -120,11 +125,15 @@ class LocationPicker extends HookConsumerWidget {
trailingIcon: const Icon(Icons.arrow_drop_down_rounded), trailingIcon: const Icon(Icons.arrow_drop_down_rounded),
selectedTrailingIcon: const Icon(Icons.arrow_drop_up_rounded), selectedTrailingIcon: const Icon(Icons.arrow_drop_up_rounded),
onSelected: (value) { onSelected: (value) {
if (value.toString() == selectedState.value) {
return;
}
selectedState.value = value.toString(); selectedState.value = value.toString();
cityTextController.value = TextEditingValue.empty;
onSelected({ onSelected({
'country': selectedCountry.value, 'country': selectedCountry.value,
'state': selectedState.value, 'state': selectedState.value,
'city': selectedCity.value, 'city': null,
}); });
}, },
), ),