vuetify: [Bug Report][3.0.0] V-App-Bar Collapse On Reload Page

Environment

Vuetify Version: 3.0.0-beta.3 Vue Version: 3.2.36 Browsers: Chrome 102.0.0.0 OS: Windows 10

Steps to reproduce

  1. You should run server (npm install && npm run dev OR npm install && npm run build && npm run start)
  2. Open / page
  3. Reload page
  4. Look at app bar
  5. Bar collapse for a few seconds (in run dev mode this collapse a bit longer)

Expected Behavior

App bar didn’t collapse or something, duo page reload

Actual Behavior

Bar collapse on every page reload. After a few seconds, bar return to valid position. If you disable javascript, app bar didn’t return to required position.

Reproduction Link

https://gitlab.com/BlackYuzia/nuxt-vuetify

Screenshots

Collapse example: image

Un Collapsed after a few seconds: image

About this issue

  • Original URL
  • State: open
  • Created 4 years ago
  • Reactions: 13
  • Comments: 27 (10 by maintainers)

Commits related to this issue

Most upvoted comments

Working on it. Since we use TSX, Vue 3.4 requires changes on our end.

This should be better on newer versions, but we’re still waiting on upstream.

This is the workaround I made using layouts

inside your template v-app v-if=“!loading” etc…

<script setup> const loading = ref(true) onMounted(() => { loading.value = false }) </script>

Any news for this ?

Suspense is still broken, we had to revert #15229.

If you’re wrapping the whole page in <client> you might as well just disable ssr entirely.

On 3.7 - this bug exists

For you can simply set following styles on VMain to overcome this issue:

<VApp
  <VAppBar>
    ... your content here
  </VAppBar>
  <VMain
      style="
        --v-layout-left: 0px;
        --v-layout-right: 0px;
        --v-layout-top: 64px;
        --v-layout-bottom: 44px;
      "
    >
    ... your content here
  </VMain>
</VApp>

I have the same issue working on nuxt@3.6.3 and vuetify@3.3.8 Is there any workaround?

try using <client></client>

Please create a new issue. https://issues.vuetifyjs.com/

This bug is still exist

image

https://github.com/vuejs/core/pull/7290 is released in vue 3.4 rc.1 Maybe it can be fixed now?

Still waiting … @cheetamaru workaround is working, but it is a hack …

Workaround for height collapsing:

<template>
    <div>
        <v-app>
            <v-app-bar ... style="width: 100%">
            ...
            </v-app-bar>
            <v-fade-transition leave-absolute>
                <div v-if="isExtraSpaceAdded" style="height: 48px" />
            </v-fade-transition>
            ...
        </v-app>
    </div>
</template>

<script setup>
const isExtraSpaceAdded = ref(true)

onMounted(() => {
  isExtraSpaceAdded.value = false
})
</script>

height: 48px is a heigth value of the v-app-bar.

Hope this bug will be fixed soon.

Same issue here. Nuxt 3 and Vuetify 3.0.0-beta.5. Similar issue if I tried replacing it with a v-toolbar instead (except v-toolbar starts bigger then contracts). Even without a drawer, it still starts each reload in the small state before expanding to the full width of the screen once the page is fully loaded.

Using a card as a workaround for now.

I have the same issue working on Nuxt 3 and Vuetify 3.0.0-beta.3 Is there any workaround ? I tried to use the <Suspense> but it’s not working in Nuxt, I tried in layouts and App.vue as well

Cheers