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

    q-tabs not horizontally scrollable until changing window width on desktop

    Framework
    6
    8
    1726
    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.
    • M
      morgosh last edited by morgosh

      On default it is not scrollable but when you change window width it adds some class called “scrollable” to element inside q-tabs, which then enables rendering of the arrows. The scrollable class has no css though.
      Example of error:
      https://gyazo.com/e2fe9ae92ea5225a8cc12bdf2265efed

      1 Reply Last reply Reply Quote 0
      • M
        morgosh last edited by

        Just realized what the problem was. The q-tabs component checks the width of all q-tab that are existing when the component is mounted, and it checks everytime the screen size changes. But while my dates are added dynamicaly after the q-tab mount ( when the server responds), the q-tab did not notice length was now actually bigger even though window size did not change. I added v-if so q-tabs is now loaded after the dates loaded and now it works properly

        A 1 Reply Last reply Reply Quote 0
        • P
          peppicus last edited by

          Hi morgosh you added v-if, but wich variable do you check?
          I’m trying to check the length of vector but it doesn’t seems to work.

          tnks in advance.

          A 1 Reply Last reply Reply Quote 0
          • A
            alsolee @peppicus last edited by alsolee

            @peppicus u can use v-if and v-else both. like this:

            <q-tabs class="fit" color="indigo" inverted swipeable v-model="selectedTab"  v-if="views.length" v-show="views.length" >
                  <q-tab :name="v[0]" slot="title" v-for="v in views" :key="v[0]">{{v[1]}}</q-tab>
                  <q-tab-pane class="fit no-padding" :name="v[0]" v-for="v in views" :key="v[0]" ref="panes">
                    <instance-view :id="id" :vid="v[0]" :modal="modal"/>
                  </q-tab-pane>
                </q-tabs>
            
            1 Reply Last reply Reply Quote -1
            • A
              aminadarwish @morgosh last edited by

              @morgosh thaaaank yoooooou

              1 Reply Last reply Reply Quote 0
              • B
                blackcodetavern last edited by

                I still have the problem even with the code from alsolee. But I append new tabs for my users dynamically. When i resize the component it works. Is there some other way to trigger an update of the q-tabs?

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

                  Tried Vue.forceUpdate() method. Anyway some reading https://michaelnthiessen.com/force-re-render.

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

                    Update: Example for those who might stumble upon this, using the article I linked above in my last comment (the key way, which the author states is the very best way).
                    https://codepen.io/metalsadman/pen/wvvjepy?editors=1011

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