Skip to content

Commit

Permalink
Frontend: Prevent horizontal scroll on search suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
AgustinSRG committed Sep 15, 2024
1 parent df3caa0 commit 609308a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
8 changes: 7 additions & 1 deletion frontend/src/components/layout/TopBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,13 @@
:class="{ hidden: suggestions.length === 0 }"
@scroll.passive="onSuggestionsScroll"
>
<div v-for="s in suggestions" :key="s.key" class="top-bar-search-suggestion" @click="clickSearch(s)">
<div
v-for="s in suggestions"
:key="s.key"
class="top-bar-search-suggestion"
@click="clickSearch(s)"
:title="s.name"
>
<i class="fas fa-tag" v-if="s.type === 'tag'"></i>
<i class="fas fa-list-ol" v-else-if="s.type === 'album'"></i>
<span>{{ s.name }}</span>
Expand Down
12 changes: 12 additions & 0 deletions frontend/src/style/layout/top-bar.css
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@
flex-direction: column;
max-height: 300px;
overflow-y: auto;
overflow-x: hidden;
}

.top-bar-search-suggestions {
Expand Down Expand Up @@ -219,6 +220,17 @@
font-size: 16px;
cursor: pointer;
text-align: left;
display: flex;
flex-direction: row;
align-items: center;
}

.top-bar-search-suggestion span {
flex: 1;
min-width: 1px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}

.top-bar-search-suggestion:hover {
Expand Down

0 comments on commit 609308a

Please sign in to comment.