Improved tooltip positioning and sizing, in particular for stashing (heart).

This commit is contained in:
2026-07-25 01:17:12 +02:00
parent e8f1dca2a0
commit eed07ba84b
5 changed files with 71 additions and 29 deletions

View File

@@ -1,7 +1,7 @@
/* Content */
.v-popper__popper {
z-index: 10000;
z-index: 1000;
top: 0;
left: 0;
outline: none;
@@ -45,6 +45,10 @@
overflow-y: auto;
}
.no-outer-scroll .v-popper__inner {
overflow: hidden;
}
.v-popper__inner > div {
position: relative;
z-index: 1;
@@ -82,6 +86,10 @@
border-width: 6px;
}
.v-popper__popper[data-popper-placement^="top"] .v-popper__arrow-container {
bottom: -7px;
}
.v-popper__popper[data-popper-placement^="top"] .v-popper__arrow-inner,
.v-popper__popper[data-popper-placement^="bottom"] .v-popper__arrow-inner {
left: -2px;
@@ -105,7 +113,7 @@
}
.v-popper__popper[data-popper-placement^="bottom"] .v-popper__arrow-container {
top: 0;
top: -2px;
}
.v-popper__popper[data-popper-placement^="bottom"] .v-popper__arrow-inner,
@@ -151,7 +159,11 @@
}
.v-popper__popper[data-popper-placement^="left"] .v-popper__arrow-container {
right: -10px;
right: -7px;
}
.v-popper__popper[data-popper-placement^="right"] .v-popper__arrow-container {
left: 2px;
}
.v-popper__popper[data-popper-placement^="left"] .v-popper__arrow-inner,

View File

@@ -248,6 +248,8 @@ async function reloadStashes(newStash) {
v-if="itemStashes && (showSecondary || (hasSecondaryStash && pageStash?.user.id !== user.id))"
:aria-id="stashMenuDropdownId"
:shown="showStashes"
placement="auto"
popper-class="no-outer-scroll"
@hide="showStashes = false"
>
<Icon
@@ -274,6 +276,8 @@ async function reloadStashes(newStash) {
:triggers="[]"
:shown="showStashes"
:disabled="showSecondary"
placement="auto"
popper-class="no-outer-scroll"
@hide="showStashes = false"
>
<template v-if="pageStash?.user.id === user.id">

View File

@@ -16,7 +16,8 @@ const emit = defineEmits(['stash', 'unstash', 'create']);
</script>
<template>
<ul class="stash-menu nolist noselect">
<div class="stash-menu noselect">
<ul class="stash-list nolist noselect">
<li
v-for="userStash in stashes"
:key="`stash-${userStash.id}`"
@@ -29,27 +30,39 @@ const emit = defineEmits(['stash', 'unstash', 'create']);
/>{{ userStash.name }}
</label>
</li>
</ul>
<li class="menu-item create">
<label
<div
v-close-popper
class="menu-stash"
class="menu-item menu-stash create"
@click="emit('create')"
>
<Icon icon="plus3" />
New
</label>
</li>
</ul>
</div>
</div>
</template>
<style scoped>
.stash-menu {
display: flex;
flex-direction: column;
max-height: inherit;
overflow: hidden;
}
.stash-list {
overflow-y: auto;
min-height: 0; /* lets this flex child actually shrink and scroll instead of pushing the container taller */
}
.menu-item {
display: flex;
.icon {
fill: var(--shadow-weak-10);
padding: 0 .55rem 0 .2rem;
transform: translateY(-1px);
}
}
@@ -58,6 +71,7 @@ const emit = defineEmits(['stash', 'unstash', 'create']);
width: 100%;
align-items: center;
padding: .5rem;
box-sizing: border-box;
&:hover {
cursor: pointer;
@@ -71,5 +85,10 @@ const emit = defineEmits(['stash', 'unstash', 'create']);
.check-container {
margin-right: .5rem;
}
&.create {
flex-shrink: 0;
border-top: 1px solid var(--glass-weak-40);
}
}
</style>

View File

@@ -32,7 +32,14 @@ function createApp(Page, pageProps, pageContext) {
app.provide('pageContext', pageContext);
app.use(FloatingVue, { container: '#container' });
app.use(FloatingVue, {
container: '#container',
autoBoundaryMaxSize: true,
shiftCrossAxis: true,
overflowPadding: 10,
arrowPadding: 10,
});
app.use(VueVirtualScroller);
app.component('Link', Link);

View File

@@ -189,7 +189,7 @@ onMounted(() => {
justify-content: center;
position: fixed;
bottom: 2rem;
z-index: 1000;
z-index: 10000;
pointer-events: none;
}