Skip to content

Commit

Permalink
fix(nav): clean search field after navigation #2349
Browse files Browse the repository at this point in the history
Approved-by: VANDERHAGHEN Luc <[email protected]>

Closes #2349

See merge request 24-heures-insa/overbookd-mono!3169
  • Loading branch information
LeonDumestre committed Jan 11, 2025
1 parent 1544530 commit 3e9ed60
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 4 deletions.
9 changes: 7 additions & 2 deletions apps/web/layouts/navigation/DesktopSideNav.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@
v-model:search-value="searchValue"
:is-folded="isFolded"
/>
<SideNavPageList :search="searchValue" :is-folded="isFolded" />
<SideNavPageList
:search="searchValue"
:is-folded="isFolded"
@click="cleanSearchField"
/>
<SideNavHelpItemList
:is-folded="isFolded"
@ask-question="openAskQuestionDialog"
Expand Down Expand Up @@ -50,7 +54,8 @@ onMounted(() => navigationBadgeStore.fetchAll());
const isDesktop = computed<boolean>(() => layoutStore.isDesktop);
const isFolded = ref<boolean>(true);
const searchValue = ref<string | undefined>(undefined);
const searchValue = ref<string | undefined>();
const cleanSearchField = () => (searchValue.value = "");
const searchInput = ref<HTMLInputElement | null>(null);
const unfocusOnSearch = () => searchInput.value?.blur();
Expand Down
4 changes: 4 additions & 0 deletions apps/web/layouts/navigation/SideNavPageItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
'unfolded-item': !isFolded,
}"
link
@click="propagateClick"
>
<template #prepend>
<v-badge
Expand Down Expand Up @@ -48,6 +49,9 @@ const isSelected = ({ to }: PageInSummary): boolean => {
const currentPage = findPage(route.path);
return currentPage?.to === to;
};
const emit = defineEmits(["click"]);
const propagateClick = () => emit("click");
</script>

<style lang="scss" scoped>
Expand Down
5 changes: 5 additions & 0 deletions apps/web/layouts/navigation/SideNavPageList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
:key="page.to"
:page="page"
:is-folded="isFolded"
@click="propagateClick"
/>
<v-divider
v-show="favoritePages.length > 0 && nonFavoritePages.length > 0"
Expand All @@ -20,6 +21,7 @@
:key="page.to"
:page="page"
:is-folded="isFolded"
@click="propagateClick"
/>
</v-list>
</template>
Expand Down Expand Up @@ -77,6 +79,9 @@ const favoritePages = computed<PageInSummary[]>(
const nonFavoritePages = computed<PageInSummary[]>(
() => PageFilter.from(filteredPages.value).nonFavorites,
);
const emit = defineEmits(["click"]);
const propagateClick = () => emit("click");
</script>

<style lang="scss" scoped>
Expand Down
2 changes: 1 addition & 1 deletion apps/web/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@overbookd/web",
"version": "3.3.74",
"version": "3.3.75",
"description": "Application web pour le logiciel de gestion du festival des 24 heures de l'INSA",
"author": "Club des 24 heures de l'INSA (https://www.24heures.org/)",
"homepage": "https://gitlab.com/24-heures-insa/overbookd-mono",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "overbookd",
"version": "3.24.1-rc.0",
"version": "3.24.1-rc.1",
"main": "index.js",
"keywords": [],
"license": "Apache-2.0",
Expand Down

0 comments on commit 3e9ed60

Please sign in to comment.