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

    How to properly insert a select inside a toolbar?

    Help
    4
    8
    279
    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.
    • rubs
      rubs last edited by rubs

      I’m trying to insert a QSelect inside a QToolbar, but I’m facing some problems. The idea is to allow the user to select one of multiple organizations by replacing the app title (previously a QToolbarTitle) with a select control.

      I kinda found a way to do it, but either the QSelect title disappears or its arrow gets pushed to the right of the remaining space. What I want is the arrow to move according to the organization title, like this:

      82f089c4-9bae-4727-a954-a4dfd904e3ed-image.png

      After spending quite some time trying to figure it out, here I’ve created a simple pen to illustrate my problem. In fact the pen is even worse than the actual app because nothing after the QSelect appears in the toolbar. (The app belongs to a client so I can’t share its code, sorry for that.)

      Any ideas? Many thanks in advance,

      1 Reply Last reply Reply Quote 0
      • s.molinari
        s.molinari last edited by

        If it is just a simple selection, how about using a QBtnDropdown?

        Scott

        rubs 1 Reply Last reply Reply Quote 0
        • dobbel
          dobbel last edited by dobbel

          its arrow gets pushed to the right

          the QSelect title disappears

          really have no idea what the problem is…

          1 Reply Last reply Reply Quote 0
          • rubs
            rubs @s.molinari last edited by

            @s-molinari said in How to properly insert a select inside a toolbar?:

            If it is just a simple selection, how about using a QBtnDropdown?

            Scott

            I may try that. However I believe the QSelect should at least work as expected, it doesn’t (see the pen).

            @dobbel said in How to properly insert a select inside a toolbar?:

            really have no idea what the problem is…

            Sorry for the confusion. I’ve added some screenshots from the actual app.

            the QSelect title disappears

            63f6112d-1fea-4425-b3ad-a5bb182dbd8f-image.png

            Here, no title when the QSelect is inserted. It is there, but its width is zero.

            its arrow gets pushed to the right

            b0f61063-cc4a-4eb1-bbc6-003d520459f8-image.png

            This happens when I surround the QSelect with a QToolbarTitle. Its width occupies the whole remaining space.

            What I want is:

            2cdb1c94-00da-4d03-beca-781f617d4bd3-image.png

            Hope it’s clearer now!

            beets 1 Reply Last reply Reply Quote 0
            • beets
              beets @rubs last edited by beets

              @rubs I noticed a typo in your codepen:

              <q-select v-model="model" :options="options"
                         options-dense borderless></select>
              

              You’re closing it with </select> and not </q-select>. When I change it, it seems to work okay for me.

              rubs 1 Reply Last reply Reply Quote 0
              • rubs
                rubs @beets last edited by

                @beets said in How to properly insert a select inside a toolbar?:

                @rubs I noticed a typo in your codepen:

                <q-select v-model="model" :options="options"
                           options-dense borderless></select>
                

                You’re closing it with </select> and not </q-select>. When I change it, it seems to work okay for me.

                You’re right, thanks! No wonder it didn’t work… So now the pen works as expected, it does not reproduce the issue I’m having. I’ll try harder, I’ll let you guys know. Thanks again.

                beets 1 Reply Last reply Reply Quote 0
                • beets
                  beets @rubs last edited by

                  @rubs No problem, it’s likely some flexbox issue, you could always try using just a <div class="row"> and see what makes it tick.

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

                    Whoa, that was fast. Just nailed it down to a CSS problem. The q-select component was inheriting a style it was not supposed to. Again, thank you guys for your help.

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