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

    toggleLeft (or close) only when on phone?

    Help
    3
    8
    1512
    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.
    • ssuess
      ssuess last edited by ssuess

      My web app works fine, but I am having some trouble with the iphone version, the drawer won’t close. I suspect this is because I replaced my <q-side-link to= elements with a function

      <q-item @click="gotointernal('/dashboard','Dashboard')">:

      gotointernal (url, bigname) {
        this.routeName = bigname
        this.$router.push(url)
      }
      

      I could add a toggleLeft to that function, but I want the sidebar to stay open if on desktop, and only close if on a small device. Any idea how I can do one of the following:

      1. Fix the drawer so it works properly again on ios (but without reverting to q-side-link)
      2. Detect open/close state of drawer
      3. Only close drawer if on iphone/android, not on desktop

      Thanks!

      1 Reply Last reply Reply Quote 0
      • ssuess
        ssuess last edited by

        The more I look at this, the stranger it is. Can anyone explain to me why my method code above (that replaces q-side-link) would fail to hide the drawer when run (via cordova) on ios, but using q-side-link DOES properly hide the drawer and return control to the page?

        1 Reply Last reply Reply Quote 0
        • ssuess
          ssuess last edited by

          This post is deleted!
          1 Reply Last reply Reply Quote 0
          • ssuess
            ssuess last edited by

            Well, I found a workaround that hopefully helps someone else. I can attach a method separately by using @click.native=“mymethod()” in q-side-link.

            1 Reply Last reply Reply Quote 0
            • T
              trsiddiqui1989 last edited by

              How did you fix this ssuess?

              ssuess 1 Reply Last reply Reply Quote 0
              • benoitranque
                benoitranque last edited by

                I had some issues when closing drawer and navigating in the same method:

                // wrong way
                this.layout.hideLeft()
                this.$router.push('/route')
                
                // right way
                this.layout.hideLeft(() => {
                  this.$router.push('/route)
                })
                

                Hope this helps

                1 Reply Last reply Reply Quote 0
                • ssuess
                  ssuess @trsiddiqui1989 last edited by ssuess

                  @trsiddiqui1989 exactly as I said above. Create a method that does what you want and attach it to @click.native in your q-side-link component. If you have a question about that, please let me know with specifics and I will try to answer in greater detail, hope this helps.

                  1 Reply Last reply Reply Quote 0
                  • T
                    trsiddiqui1989 last edited by

                    The problem is, hideLeft is not working on the side bar which comes with an overlay.

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