Skip to content

Commit 9b6acd3

Browse files
authored
Fix submitting cancels search (#687)
1 parent 08d6eed commit 9b6acd3

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

kitchenowl/lib/pages/household_page/shoppinglist.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ class _ShoppinglistPageState extends State<ShoppinglistPage> {
6363
if (state.result.first is! ShoppinglistItem) {
6464
cubit.add(state.result.first);
6565
}
66+
} else {
67+
cubit.search(searchController.text);
6668
}
6769
},
6870
),

kitchenowl/lib/pages/item_search_page.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@ class _ItemSearchPageState extends State<ItemSearchPage> {
6666
alwaysExpanded: true,
6767
textInputAction: TextInputAction.done,
6868
onSubmitted: () {
69+
if (cubit.state.query != searchController.text) {
70+
cubit.search(searchController.text);
71+
return;
72+
}
6973
if (cubit.state.selectedItems
7074
.contains(cubit.state.searchResults.first)) return;
7175
if (!widget.multiple) {

0 commit comments

Comments
 (0)