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

    Is it possible to make the select input scrollable?

    Help
    2
    4
    434
    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.
    • E
      embluk last edited by

      At the moment the select input when you add new values to it will keep expanding, for example:

      e15ce53d-130c-4d25-90fc-b94fe622117b-image.png

      And when I put some styling on the input to include a scroll:

      a281a00d-7c6b-44be-b2d2-1e363376984c-image.png

      Am I missing something or is there a way to do this with the framework and select inputs? Making it so the select input has a max-height and a scroll bar because otherwise it will keep expanding? I don’t mind the select input expanding but I have a use case where I need to control the max height.

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

        @embluk thats what the input-class and input-style props are for.

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

          @metalsadman Thanks for the suggestion but it doesn’t work for me? I’ve kind of got it working with the following CSS:

          .inputStyle .q-field__inner .q-field__control
          {
              padding-right: 0;
          }
          
          .inputStyle .q-field__inner .q-field__control .q-field__control-container
          {
              max-height: 180px;
              overflow-y: scroll;
              overflow-x: auto;
          }
          

          But it would be a great addition to the select inputs I think, natively.

          1 Reply Last reply Reply Quote 0
          • E
            embluk last edited by embluk

            To improve the look and style I changed the CSS a little:

            .inputStyle .q-field__inner .q-field__control
            {
                padding-right: 0;
                min-height: unset;
            }
            
            .inputStyle .q-field__inner .q-field__control .q-field__control-container
            {
                margin-top: 16px;
                margin-bottom: 16px;
                min-height: unset;
            }
            
            .inputStyle .q-field__inner .q-field__control .q-field__control-container .q-field__native
            {
                padding: 0;
                padding-right: 12px;
                min-height: unset;
                max-height: 130px;
                overflow-y: auto;
                overflow-x: hidden;
            }
            

            Centres the scroll bar and adds space above and below the chips and only shows scroll bar when you go past the max height. Starts off with the same height as normal at 56px.

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