Skip to content

Scroll doesn't follow active item #223

Open
@mikaelboff

Description

@mikaelboff

Describe the bug
I've set a max-height and overflow:auto to the ul element, so I can have scroll on the context menu. When i have too much items in the context menu and i navigate with arrowUp or arrowDown keys, the scroll doesn't follow the active item

To Reproduce
Steps to reproduce the behavior:

  1. add the following css to the application:
.cdk-overlay-pane.ngx-contextmenu ul {
    max-height: 234px;
    overflow: auto;
}
  1. Open a context menu with too much items (40 or 50)
  2. Press successively arrowDown key until the active item gets hiden
  3. You will notice that the scroll doesn't move, and the active item is not visible

Expected behavior
It's expected that the scroll should move together when the active item is not more visible on the screen

Stackblitz Example
Please fork this base example to demonstrate the issue you're experiencing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions