-
+
{{ 'core.courses.totalcoursesearchresults' | translate:{$a: total} }}
diff --git a/src/core/courses/pages/search/search.ts b/src/core/courses/pages/search/search.ts
index e3d56dcfb..e05a4a703 100644
--- a/src/core/courses/pages/search/search.ts
+++ b/src/core/courses/pages/search/search.ts
@@ -52,6 +52,18 @@ export class CoreCoursesSearchPage {
});
}
+ /**
+ * Clear search box.
+ *
+ * @param e The event object.
+ */
+ clearSearch(e: Event): void {
+ this.currentSearch = '';
+ this.courses = undefined;
+ this.page = 0;
+ this.total = 0;
+ }
+
/**
* Load more results.
*
diff --git a/src/core/search/components/search-box/search-box.ts b/src/core/search/components/search-box/search-box.ts
index 5295790c5..2826043a1 100644
--- a/src/core/search/components/search-box/search-box.ts
+++ b/src/core/search/components/search-box/search-box.ts
@@ -117,7 +117,7 @@ export class CoreSearchBoxComponent implements OnInit, OnDestroy {
*/
protected async saveSearchToHistory(text: string): Promise {
try {
- await this.searchHistoryProvider.insertOrUpdateSearchText(this.searchArea, text);
+ await this.searchHistoryProvider.insertOrUpdateSearchText(this.searchArea, text.toLowerCase());
} finally {
this.loadHistory();
}