Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calcite Dropdown: If dropdown has many items, it should have its own scrollbar #396

Closed
dhrumil83 opened this issue Mar 18, 2020 · 6 comments · Fixed by #418
Closed

Calcite Dropdown: If dropdown has many items, it should have its own scrollbar #396

dhrumil83 opened this issue Mar 18, 2020 · 6 comments · Fixed by #418
Assignees

Comments

@dhrumil83
Copy link

codepen: https://codepen.io/dhrumil83/pen/xxGzJBm

Couple of issues:

  1. Dropdown has 50 items. It ends up using the pages scrollbar to show ~20-25 items. Only way to get to the rest of them is to use the key down button on the keyboard,
    Calcite-dropdown should have its own scrollbar, similar to select.

image

  1. When dropdown is opened, scroll/show by default to the active item. (Item50 in the codepen)
@jcfranco jcfranco added this to the 🔨 v1-beta.21 milestone Mar 19, 2020
@jcfranco
Copy link
Member

@macandcheese @paulcpederson I can take this one if you want. 😄 Any recommendations on a max-height for scrolling?

@paulcpederson
Copy link
Member

Probably best to pick something fairly large and then add media queries based on screen height. Maybe like 400px?

@macandcheese
Copy link
Contributor

Thanks @jcfranco. Maybe mirror width with a height: "s/m/l/auto", and default to "auto" which doesn't have a max height? It becomes kind of arbitrary to decide on these heights. Open to anything really.

It'd be a chore to implement but it would be nice if you could specify a number of items to display before scroll vs. a height. Maybe down the line, ha.

@jcfranco jcfranco self-assigned this Mar 19, 2020
@jcfranco
Copy link
Member

The dropdown already imposes a max-height, so maybe we just need to enable scrolling on the wrapper?

For the second part of this issue, should we always try to focus the active item and fallback to the first one when the dropdown is opened?

@macandcheese
Copy link
Contributor

Re: focusing, I think right now it only focuses the first item when opened via key, and not on click...

I had initially thought about focusing the active item but decided not to - I think focusing on the active one makes sense for "single" selection mode, but it got weird for "multi" - as in what would be the best UX for "multi" selection mode (and then for "none" just focusing the first one)

Open to adding it though!

@macandcheese
Copy link
Contributor

I suppose for "multi" we could just focus the first instance of an active item 🤷‍♂️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants