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

    [Solved] autocomplete results width / overflow

    Help
    2
    6
    1659
    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.
    • krsyoung
      krsyoung last edited by krsyoung

      Hi, I am successfully using the q-autocomplete component however the data that I return is quite long. I’m noticing on mobile displays that it overflows off the side of the screen. The main issue is that results with long strings that have the same starting characters can’t be differentiated between by the user.

      Any advice from folks on how to work around this? (i.e. break lines, enable wrap on the autocomplete result list popover…)

      Thanks!

      1 Reply Last reply Reply Quote 0
      • rstoenescu
        rstoenescu Admin last edited by

        First thing coming to my mind is putting a max-width 90vw (or whatever). What version you on?

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

          Hi @rstoenescu, will give that a try and report back. I’m on 0.13.10. Thanks!

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

            I tried adding a max-width: 90vw on the item-content class, however that truncates the line (adds the ... at the end of the line). Applying the width to the list level just reduces the width of the overall list with the text still running off the screen.

            Will keep poking around.

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

              The winner for the moment (have not verified side effects …). I include the following in the view where the autocomplete is loaded:

              <style>
              .item {
                height: inherit;
                max-width: 95vw;
              }
              
              .q-popover .item:not(.two-lines):not(.three-lines):not(.multiple-lines)>.item-content>div:not(.stacked-label):not(.floating-label):not([class^=q-]) {
                white-space: normal;
              }
              </style>
              

              Ugly due to the required specificity but it works.

              1 Reply Last reply Reply Quote 0
              • rstoenescu
                rstoenescu Admin last edited by

                Can you try with v0.14 beta also please (without any additional CSS)?

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