I don't want the top of the navigation to be hidden when I scroll to the bottom of the page and see the footer.
Below is the state before scrolling.
Below is a screenshot when scrolling down to the page.
Here is the code
<template>
<div id="app">
<v-app>
<v-app-bar>header</v-app-bar>
<div class="d-flex flex-0-1-100">
<v-navigation-drawer
border="r"
permanent
fixed
class="pa-1 position-sticky"
style="max-height: calc(100vh - 64px)"
>
<div style="border: 2px solid pink; height: 100%">
nav bar
<v-text-field
v-model.number="contentHeight"
min="0"
step="400"
type="number"
label="content height (px)"
/>
</div>
</v-navigation-drawer>
<v-main class="bg-grey pl-0">
Main content
<div
:style="{height: contentHeight + 'px'}"
class="bg-brown-darken-2"
>
content ({{contentHeight}}px)
</div>
</v-main>
</div>
<v-footer border="t">footer</v-footer>
</v-app>
</div>
</template>
<script setup>
import { ref } from 'vue'
const contentHeight = ref(1000)
</script>
I would appreciate it if you could check the playground
I have tried the following
When I remove the "position-sticky" class from the "v-navigation-drawer," the navigation area at the top does not move upwards even when the footer is visible. However, in doing so, the navigation extends horizontally beyond the footer's boundary, as shown in the image below:
I may not be able to explain it well in English, but as a layout https://pro-bravia.sony.net/en/guides/ I want it to be the same as if I scrolled down to this site
In the application I'm currently developing, if I use the following v-navigation-drawer, the height of the navigation is halved.
<client-only>
<v-navigation-drawer
permanent
class="position-sticky"
:style="{ maxHeight, minWidth }"
style="
height: fit-content;
margin-top: 64px;
"
width="250"
>
<v-row justify="center">
<v-expansion-panels :modelValue="panel" :multiple="true">
<v-expansion-panel
v-for="(item, i) in matchedNavObject.children"
:key="i"
>
<v-expansion-panel-title>{{ item.title }}</v-expansion-panel-title>
<v-expansion-panel-text
v-for="(navItem, j) in item.children"
:key="j"
>
<nuxt-link
:to="`${baseUrl}${navItem._path}`"
class="text-decoration-none"
:class="{
active: `${navItem._path}/` === route.path,
}"
>{{ navItem.title }}</nuxt-link
>
</v-expansion-panel-text>
</v-expansion-panel>
</v-expansion-panels>
</v-row>
</v-navigation-drawer>
</client-only>