Skip to content

Listbox doesn't scroll the container when an item is focused #1504

@honzatmn

Description

@honzatmn

🐛 Bug Report

When Listbox is wrapped in a container with overflow auto, it doesn't automatically scroll when items are focused.

🤔 Expected Behavior

  • It should scroll the parent container when I move up and down by arrows, so the focused item is always visible.

😯 Current Behavior

  • It doesn't scroll.
  • It works on first focus. If the focused item is e.g. item "Eight", I click out of the box, scroll the box up, and hit Tab, it will scroll the item "Eight" to the view correctly.

🔦 Context

I discovered this when used in Popover if it helps somehow, but it seems it's general behavior.

💻 Code Sample

https://codesandbox.io/s/modest-haze-wqeoz

🌍 Your Environment

https://www.whatsmybrowser.org/b/T752W

🧢 Your Company/Team

Not working at Adobe.

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