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

Reposition Dropdown menu when selection is empty #104

Closed
wants to merge 1 commit into from

Conversation

abynim
Copy link

@abynim abynim commented May 16, 2022

Steps to reproduce issue:

  • Add a Dropdown component with empty (null) value
  • Add 10 or more Dropdown options
  • Position the Dropdown near the top of the plugin window

When selection is empty, the Dropdown component positions its menu vertically centered in relation to the dropdown. With a large enough list of options, the menu could get cut off at the top, with no way to scroll up.

In this PR we position the menu such that the first menu item is directly above the dropdown component when dropdown selected value is null.

dropdown-update

Try to adjust the `top` position of `menuElement` such that either `selectedElement` *or the first menu item* is directly above the `rootElement`
@yuanqing yuanqing deleted the branch yuanqing:next June 5, 2022 13:07
@yuanqing yuanqing closed this Jun 5, 2022
@yuanqing yuanqing reopened this Jun 5, 2022
@yuanqing yuanqing deleted the branch yuanqing:next June 6, 2022 16:50
@yuanqing yuanqing closed this Jun 6, 2022
@yuanqing
Copy link
Owner

yuanqing commented Jun 7, 2022

The logic for rendering the Dropdown menu was recently updated (in #97, #100), and this issue should be fixed in 2.0.0

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 this pull request may close these issues.

2 participants