diff --git a/src/components/MinimalView/MinimalSearch.vue b/src/components/MinimalView/MinimalSearch.vue index 74c8311b..bf88a8db 100644 --- a/src/components/MinimalView/MinimalSearch.vue +++ b/src/components/MinimalView/MinimalSearch.vue @@ -1,202 +1,39 @@ - - - - - {{ $t('search.enter-to-search-web') }} - - - x - + - - diff --git a/src/components/Settings/SearchBar.vue b/src/components/Settings/SearchBar.vue index 9a1fa72d..0058032f 100644 --- a/src/components/Settings/SearchBar.vue +++ b/src/components/Settings/SearchBar.vue @@ -1,5 +1,5 @@ - + {{ $t('search.search-label') }} diff --git a/src/utils/Search.js b/src/utils/Search.js index f03078bc..50950183 100644 --- a/src/utils/Search.js +++ b/src/utils/Search.js @@ -24,7 +24,7 @@ const getDomainFromUrl = (url) => { */ const filterHelper = (compareStr, searchStr) => { if (!compareStr) return false; - const process = (input) => input.toString().toLowerCase().replace(/[^\w\s]/gi, ''); + const process = (input) => input && input.toString().toLowerCase().replace(/[^\w\s]/gi, ''); return process(compareStr).includes(process(searchStr)); }; @@ -37,6 +37,7 @@ const filterHelper = (compareStr, searchStr) => { * @returns A filtered array of tiles */ export const searchTiles = (allTiles, searchTerm) => { + if (!searchTerm) return allTiles; // If no search term, then return all if (!allTiles) return []; // If no data, then skip return allTiles.filter((tile) => { const { diff --git a/src/views/Minimal.vue b/src/views/Minimal.vue index cf2b9aa9..ba3e49c6 100644 --- a/src/views/Minimal.vue +++ b/src/views/Minimal.vue @@ -10,7 +10,9 @@ {{ pageInfo.title }} - { this.searchValue = s; }" :active="!modalOpen" /> + { this.searchValue = s; }" + :active="!modalOpen" ref="filterComp" /> @@ -82,7 +84,7 @@ export default { watch: { /* When the theme changes, then call the update method */ searchValue() { - this.tabbedView = !(this.searchValue.length > 0); + this.tabbedView = !this.searchValue || this.searchValue.length === 0; }, }, methods: { @@ -111,7 +113,7 @@ export default { }, /* Clears input field, once a searched item is opened */ finishedSearching() { - this.$refs.filterComp.clearFilterInput(); + this.$refs.filterComp.clearMinFilterInput(); }, /* Extracts the site name from domain, used for the searching functionality */ getDomainFromUrl(url) {
- {{ $t('search.enter-to-search-web') }} -