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

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

Open
mgmeyers opened this issue Dec 28, 2021 · 0 comments
Open

Comments

@mgmeyers
Copy link

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

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

No branches or pull requests

1 participant