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

[Bug]: Dropdown virtualized menu - wrong height calculation #2060

Open
Andrew-Zakharov opened this issue Apr 11, 2024 · 1 comment
Open

[Bug]: Dropdown virtualized menu - wrong height calculation #2060

Andrew-Zakharov opened this issue Apr 11, 2024 · 1 comment
Labels

Comments

@Andrew-Zakharov
Copy link

Andrew-Zakharov commented Apr 11, 2024

Vibe version

2.102.0

Describe the bug

Menu height of virtualized Dropdown is slightly greater than non-virtualized one.
That results in extra bottom padding ("No options" text is no longer centered vertically).

Expected behavior

Menu height of virtualized Dropdown properly calculates to not to produce extra paddings.

Steps to reproduce

  1. Create Dropdown
  2. Set some reasonable width for it
  3. Set isVirtualized property to true

Reproduction example link

https://codesandbox.io/p/sandbox/frosty-wildflower-4j8fwl?file=%2Fsrc%2FApp.js%3A12%2C24

System Info

No response

Additional context, Screenshots

Screen.Recording.2024-04-11.at.12.54.08.mp4
@Andrew-Zakharov Andrew-Zakharov added the bug Something isn't working label Apr 11, 2024
@Hossein-Mirazimi
Copy link
Contributor

Hi

I've looked into this issue and I believe the problem is coming from the combination of the react-select and react-windowed-select packages.

When the isVirtualized prop is set, the WindowedMenuList component from the react-windowed-select package is used. It seems that this component handles the menu's rendering and layout, which includes how the "No options" section is displayed. Unfortunately, we don't have direct control over how the padding and height are calculated within this component.

This could explain the extra space and the misalignment of the "No options" text when using the virtualized dropdown.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants