TF-3002 [MOBILE] Allow search when empty string query in search input
This commit is contained in:
@@ -747,22 +747,24 @@ class SearchEmailController extends BaseController
|
|||||||
}
|
}
|
||||||
|
|
||||||
void onTextSearchSubmitted(BuildContext context, String text) {
|
void onTextSearchSubmitted(BuildContext context, String text) {
|
||||||
final query = text.trim();
|
if (text.trim().isNotEmpty) {
|
||||||
if (query.isNotEmpty) {
|
saveRecentSearch(RecentSearch.now(text.trim()));
|
||||||
saveRecentSearch(RecentSearch.now(query));
|
|
||||||
submitSearchAction(context, query);
|
|
||||||
}
|
}
|
||||||
|
submitSearchAction(context, text);
|
||||||
}
|
}
|
||||||
|
|
||||||
void setTextInputSearchForm(String value) {
|
void setTextInputSearchForm(String value) {
|
||||||
textInputSearchController.text = value;
|
textInputSearchController.text = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
void clearAllTextInputSearchForm() {
|
void clearAllTextInputSearchForm({bool requestFocus = false}) {
|
||||||
textInputSearchController.clear();
|
textInputSearchController.clear();
|
||||||
currentSearchText.value = '';
|
currentSearchText.value = '';
|
||||||
listSuggestionSearch.clear();
|
listSuggestionSearch.clear();
|
||||||
listContactSuggestionSearch.clear();
|
listContactSuggestionSearch.clear();
|
||||||
|
if (requestFocus) {
|
||||||
|
textInputSearchFocus.requestFocus();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void clearAllResultSearch() {
|
void clearAllResultSearch() {
|
||||||
|
|||||||
@@ -159,7 +159,7 @@ class SearchEmailView extends GetWidget<SearchEmailController>
|
|||||||
height: 18,
|
height: 18,
|
||||||
fit: BoxFit.fill),
|
fit: BoxFit.fill),
|
||||||
tooltip: AppLocalizations.of(context).clearAll,
|
tooltip: AppLocalizations.of(context).clearAll,
|
||||||
onTap: controller.clearAllTextInputSearchForm);
|
onTap: () => controller.clearAllTextInputSearchForm(requestFocus: true));
|
||||||
} else {
|
} else {
|
||||||
return const SizedBox.shrink();
|
return const SizedBox.shrink();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user