Skip to content

Dropdown's height incorrectly calculated, dropdown placed offscreen #349

@mgmeyers

Description

@mgmeyers

Because the dropdown's height is calculated as this.items.length * cursorOffset.lineHeight (https://github.com/yuku/textcomplete/blob/main/packages/textcomplete-core/src/Dropdown.ts#L227) when a max-height is set on the dropdown element, it's height is incorrectly calculated. This means the dropdown will be placed offscreen in certain circumstances, especially when there are a lot of items.

Could this.el.clientHeight be used instead?

This dropdown can show up to 100 items:

Screen Shot 2021-12-28 at 10 31 23 AM

When I narrow the list down, it correctly displays on screen:

Screen Shot 2021-12-28 at 10 45 13 AM

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