mirror of
https://github.com/immich-app/immich.git
synced 2025-06-03 13:46:47 -04:00
fix: align camera model drop down behavior with other drop downs on web and mobile (#11951)
* fix(web): align search filter behavior to show all camera models * fix(mobile): align search filter behavior to clear camera model when make is set * (mobile) correctly clear the model controller * fix(mobile) re-add text controller to dropdown --------- Co-authored-by: Alex <alex.tran1502@gmail.com>
This commit is contained in:
parent
7a4fccb1b2
commit
b41af65997
@ -51,10 +51,14 @@ class CameraPicker extends HookConsumerWidget {
|
|||||||
controller: makeTextController,
|
controller: makeTextController,
|
||||||
leadingIcon: const Icon(Icons.photo_camera_rounded),
|
leadingIcon: const Icon(Icons.photo_camera_rounded),
|
||||||
onSelected: (value) {
|
onSelected: (value) {
|
||||||
|
if (value.toString() == selectedMake.value) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
selectedMake.value = value.toString();
|
selectedMake.value = value.toString();
|
||||||
|
modelTextController.value = TextEditingValue.empty;
|
||||||
onSelect({
|
onSelect({
|
||||||
'make': selectedMake.value,
|
'make': selectedMake.value,
|
||||||
'model': selectedModel.value,
|
'model': null,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
@ -29,6 +29,7 @@ class SearchDropdown<T> extends StatelessWidget {
|
|||||||
return LayoutBuilder(
|
return LayoutBuilder(
|
||||||
builder: (context, constraints) {
|
builder: (context, constraints) {
|
||||||
return DropdownMenu(
|
return DropdownMenu(
|
||||||
|
controller: controller,
|
||||||
leadingIcon: leadingIcon,
|
leadingIcon: leadingIcon,
|
||||||
width: constraints.maxWidth,
|
width: constraints.maxWidth,
|
||||||
dropdownMenuEntries: dropdownMenuEntries,
|
dropdownMenuEntries: dropdownMenuEntries,
|
||||||
|
@ -18,13 +18,12 @@
|
|||||||
|
|
||||||
$: makeFilter = filters.make;
|
$: makeFilter = filters.make;
|
||||||
$: modelFilter = filters.model;
|
$: modelFilter = filters.model;
|
||||||
$: handlePromiseError(updateMakes(modelFilter));
|
$: handlePromiseError(updateMakes());
|
||||||
$: handlePromiseError(updateModels(makeFilter));
|
$: handlePromiseError(updateModels(makeFilter));
|
||||||
|
|
||||||
async function updateMakes(model?: string) {
|
async function updateMakes() {
|
||||||
const results: Array<string | null> = await getSearchSuggestions({
|
const results: Array<string | null> = await getSearchSuggestions({
|
||||||
$type: SearchSuggestionType.CameraMake,
|
$type: SearchSuggestionType.CameraMake,
|
||||||
model,
|
|
||||||
includeNull: true,
|
includeNull: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user