Skip to content

Commit

Permalink
FIX auto-completion personnes apres changement domaine
Browse files Browse the repository at this point in the history
  • Loading branch information
clementdelafontaine committed May 2, 2024
1 parent 4310a67 commit 300e5ad
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion components/common/results/ResultComponents.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
</div>
</h1>
</div>
<h1 id="returned-results-statement" v-else>{{ $t("results.searching") }}</h1>
<h1 id="returned-results-statement" role="status" v-else>{{ $t("results.searching") }}</h1>
</div>
</Transition>

Expand Down
7 changes: 4 additions & 3 deletions components/personnes/search/SearchBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="searchbar">
<v-combobox role="search" class="searchbar__input" label="Rechercher des personnes, par nom ou par domaine d’expertise"
:items="suggestions" :menu="isSuggestionActive && suggestions.length != 0" :menu-props="menuProps"
:hide-no-data="!isSuggestionActive || suggestions.length == 0"
:hide-no-data="!isSuggestionActive || suggestions.length === 0"
:no-data-text="isSuggestionLoading ? $t('personnes.searchBar.loading') : $t('personnes.searchBar.noData')"
v-model="request" v-model:search="requestSearch" variant="outlined" cache-items hide-details hide-selected
no-filter density="compact" return-object type="text" menu-icon="" @keydown.enter="search"
Expand Down Expand Up @@ -122,9 +122,12 @@ onMounted(
requestSearch.value = "";
setQuery(request.value);
}
isSuggestionActive.value = !isSuggestionDisabledCheckbox.value;
} else {
isSuggestionActive.value = true;
}
if (currentRoute.query && currentRoute.query.domaine) {
setDomaine(decodeURI(currentRoute.query.domaine));
} else {
Expand All @@ -145,7 +148,6 @@ function clearSearch() {
* Fonction pour rechercher
*/
async function search() {
if (request.value === null || request.value === undefined) request.value = "";
isSuggestionActive.value = false;
Expand Down Expand Up @@ -178,7 +180,6 @@ const suggestions = ref([]);
* Watcher pour compléter la saisie dans la barre de recherche
*/
watch(requestSearch, async (candidate) => {
if (candidate != null && candidate.value != query.value && candidate != "[object Object]" && candidate.length > 2 && isSuggestionActive.value) {
await getSuggestionPersonne(candidate);
} else {
Expand Down

0 comments on commit 300e5ad

Please sign in to comment.