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

    open a menu/list outside of the drawer

    Framework
    2
    10
    595
    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.
    • A
      amoss last edited by

      Hi

      I have a qDrawer to the left with a qInput for the user to search with.
      I’m using a qList component for the results and it is shown below the search input pushing down everything below.
      How is it possible (css? something else?) to make it appear floating outside the drawer as a continuation to the search field itself?

      1.png

      If not outside, it could be below but “floating”, for example, something like this
      floating down

      Thanks

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

        @amoss wrap your qlist in a qmenu.

        1 Reply Last reply Reply Quote 0
        • A
          amoss last edited by

          I think I’m misunderstand something. The working code is like the following:

          <q-input>
          </q-input>
          <q-list v-if="results.length > 0">
          </q-list>
          

          I wrap q-list with q-menu but nothing showed up (I moved the v-if to the menu section).
          I then moved everything inside q-input

          <q-input>
             <q-menu v-if...>
                <q-list>
                </q-list>
             </q-menu>
          </q-input>
          

          Again nothing showed up. I removed the q-menu section

          <q-input>
                <q-list v-if...>
                </q-list>
          </q-input>
          

          And then the list appeared as hovering the q-input, almost transparent and not intuitive.

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

            @amoss please take time to read the docs and it’s exampes, it’s easy to pull those in a codepen and copy paste other example to test their combination. ie. qinput and qmenu. https://codepen.io/metalsadman/pen/rNxKRZj.

            1 Reply Last reply Reply Quote 0
            • A
              amoss last edited by

              I understand the confusion.

              It worked on my side as well but I needed to click the q-input for the menu to show itself.
              I wanted to show it once results.length > 0 so I used the v-if (that worked for the q-list) instead of v-model.
              I now used the v-model and it works great.
              Thanks!

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

                @amoss again that’s covered in the docs, many ways to show this either giving it a boolean model or a ref to show it depending on a condition. edit. look like you got it sorted out, gratz :).

                1 Reply Last reply Reply Quote 0
                • A
                  amoss last edited by

                  It is in the docs, my mistake was copying the “working” method for q-list into the q-menu… didn’t notice the different. Thanks a lot!

                  1 Reply Last reply Reply Quote 1
                  • A
                    amoss last edited by

                    *difference

                    1 Reply Last reply Reply Quote 0
                    • A
                      amoss last edited by

                      There’s one small problem.
                      When clicking the q-input for the first time, the focus is immediately lost. Only when clicking it the second time, the focus remains.
                      The menu is visible only after the user enters several characters so the need to double click to gain focus is a bit misleading…
                      Please advice
                      Thanks

                      1 Reply Last reply Reply Quote 0
                      • A
                        amoss last edited by

                        That worked like a charm: https://forum.quasar-framework.org/topic/3782/autocomplete-keep-focus-on-input-with-custom-menu/4

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