Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Suggestion List Styling Issues #405

Closed

Description

@Qusic

Themes Known To Have Issues

  • Unity

Scenarios Leading To Suggestion List Styling Issues

Related Issues

Original Issue Report Below

I'm working on the you-complete-me provider with autocomplete-plus 2.11.0
selected row gets right aligned.
does anyone know to fix it?

image

Activity

  1. benogle commented on Apr 20, 2015

    @benogle
    Contributor

    What theme are you using?

  2. Qusic commented on Apr 20, 2015

    @Qusic
    Author

    I tried One Dark, One Light, Atom Dark, Atom Light.

  3. Qusic commented on Apr 20, 2015

    @Qusic
    Author

    Sorry. I don't realize the UI Theme option and just changed the Syntax Theme.
    The problem is gone with another UI Theme. The culprit theme is Unity.

  4. changed the title [-]broken popover style[/-] [+]Suggestion List Styling Issues With Some Themes[/+] on Apr 23, 2015
  5. changed the title [-]Suggestion List Styling Issues With Some Themes[/-] [+]Suggestion List Styling Issues[/+] on Apr 23, 2015
  6. ctolkien commented on Apr 23, 2015

    @ctolkien

    Typescript and C# packages also impacted:

    Issue is when we have max-width and an element overflows.

    Here's a codepen demonstrating the issue:

    http://codepen.io/anon/pen/BNaGwN

  7. simurai commented on May 8, 2015

    @simurai
    Contributor

    Tried to look into this and it's pretty tricky.

    Fixed width

    Branch: https://github.com/simurai/autocomplete-plus/tree/sm-overflow-flexbox
    Changed from float to flexbox and table-layout: fixed. Works with truncating, but it always stays at the max-width:

    flexbox

    Overflow scroll

    Branch: https://github.com/simurai/autocomplete-plus/tree/sm-overflow-scrolling
    Another option would be to not use table-layout: fixed so it takes up the width of the content, just prevent wrapping. When it overflows you have to scroll to see the right labels:

    scroll

    Colums

    What might work better is not use a table, but simulate it by having 4 columns that get filled with the items. Then they can be easier collapsed/resized with flexbox.

    <!-- 4 vertical columns that contain rows with items -->
    <span class="icon-container"><!-- item1, item2, item3 --></span>
    <span class="left-label"><!-- item1, item2, item3 --></span>
    <span class="word"><!-- item1, item2, item3 --></span>
    <span class="right-label"><!-- item1, item2, item3 --></span>

    Programmatic truncation

    If there is a long word, it might could get truncated programmatically. And not at the end, but in the middle. That would have the benefit that you could see the end of long words that start the same.

    // instead of
    veryVeryVeryVeryVeryVeryVeryVery...
    veryVeryVeryVeryVeryVeryVeryVery...
    
    // truncate in the middle
    veryVeryVeryVe...eryVeryLongWord1
    veryVeryVeryVe...eryVeryLongWord2
    
  8. benogle commented on May 8, 2015

    @benogle
    Contributor

    Now it truncates let label, word, and right label based on a max width for each:

    screen shot 2015-05-08 at 1 17 12 pm
    screen shot 2015-05-08 at 1 17 43 pm

  9. benogle commented on May 8, 2015

    @benogle
    Contributor

    Programmatic truncation

    This would be cool. Though, I like the simplicity of the CSS approach.

  10. mnquintana commented on May 8, 2015

    @mnquintana
    Contributor

    @benogle With this change, is there any way to see the untruncated strings? (ie. by hovering with the mouse, selecting with the keyboard, and showing a tooltip or something)

  11. benogle commented on May 8, 2015

    @benogle
    Contributor

    Not at this time, but definitely willing to do that

  12. simurai commented on May 9, 2015

    @simurai
    Contributor

    Now it truncates let label, word, and right label based on a max width for each:

    👍

    I tried out the flexbox Colums in this CodePen

    screen shot 2015-05-09 at 11 47 14 am

    The nice thing would be that if everything is too long, it favors the "word" column and gives it more space (1 + 3). But if the words are all short and the labels long (2 + 4), then it doesn't truncate the labels and shows them in full.

    But it requires a lot of changes, so maybe for now we can keep as is and look into it at a later point again.

  13. joefitzgerald commented on May 9, 2015

    @joefitzgerald
    Contributor

    But it requires a lot of changes, so maybe for now we can keep as is and look into it at a later point again.

    Can you rough out a list of the changes required? I'm not averse to tackling this, but need someone like you who actually knows their way around the DOM and CSS to make it happen.

  14. benogle commented on May 11, 2015

    @benogle
    Contributor

    Nice @simurai Looks like a better, more elegant solution than mine.

  15. simurai commented on May 12, 2015

    @simurai
    Contributor

    Well, it's just an "out of context" demo.. there might still be issues once it would be in Atom.

    The main difference is that instead of vertical rows with items,

    <ol class="list-group">
      <li>
        <span class="icon-container">f</span>
        <span class="left-label">left label</span>
        <span class="word-container">
          <span class="word">word</span>
          <span class="right-label">right label</span>
        </span>
      </li>
      <li>
        <span class="icon-container">f</span>
        <span class="left-label">left label</span>
        <span class="word-container">
          <span class="word">word</span>
          <span class="right-label">right label</span>
        </span>
      </li>
    </ol>

    there would be horizontal columns with items:

    <ol class="list-group">
      <li class="icon-container">
        <span class="item">f</span>
        <span class="item">f</span>
      </li>
      <li class="left-label">
        <span class="item">left label</span>
        <span class="item">left label</span>
      </li>
      <li class="word">
        <span class="item">word</span>
        <span class="item">word</span>
      </li>
      <li class="right-label">
        <span class="item">right label</span>
        <span class="item">right label</span>
      </li>
    </ol>

    So a "line" would be split up and put into the 4 horizontal containers. I guess the whole template, JS and specs would need to change.. so not sure. Maybe it's better to not hold up the integration into core with this, and we can look at it again later.

  16. added a commit that references this issue on Feb 22, 2026
    a262af6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions