No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    Page doesn't scroll to top when switching between pages

    Help
    1
    1
    89
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • X
      XanCeegor last edited by

      I’m creating an Android app using Capacitor and Quasar. I have a weird issue when switching between pages from my sidebar. I want every page to start at the top. When I’m on a page and scroll down on it, and then switch to a different page, that page is shown scrolled down (not scrolled to the top as I’d expect). Why is this?
      I have the following set up in my router “index.js” file and I’ve tried a bunch of answers I’ve found online and on StackOverflow which didn’t help:

      export default function (/* { store, ssrContext } */) {
        const Router = new VueRouter({
          scrollBehavior: () => ({ x: 0, y: 0 }),
          routes,
      
          // Leave these as is and change from quasar.conf.js instead!
          // quasar.conf.js -> build -> vueRouterMode
          // quasar.conf.js -> build -> publicPath
          mode: process.env.VUE_ROUTER_MODE,
          base: process.env.VUE_ROUTER_BASE
        })
      
        return Router
      }
      

      It’s worth noting that this works fine on a web browser, but when I build using “quasar dev -m capacitor -T android” and install and run the APK on a physical device, the scrolling does not work as I expect it to. What can I try to fix this?
      Thanks!

      1 Reply Last reply Reply Quote 0
      • First post
        Last post