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

the menu scrolls when the item is not completely in the menu #59

Open
gege83 opened this issue Apr 15, 2021 · 4 comments
Open

the menu scrolls when the item is not completely in the menu #59

gege83 opened this issue Apr 15, 2021 · 4 comments
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@gege83
Copy link

gege83 commented Apr 15, 2021

Thank you for your work, it saved us. We found some very funny behaviour that you might be able to fix.

reproduce:

  • create a windowed select box.
  • create more options then the threshold,
  • open the menu
  • scroll to have an item which is not fully shown
  • move your mouse over it

behaviour
expected: nothing happens
actual: the menu will scroll to the item.

alternative

  • create a windowed select box.
  • create more options then the threshold,
  • open the menu
  • scroll to the end
  • move your mouse just a bit above the first shown element

behaviour
expected: nothing happens
actual: the menu slowly scrolls upwards

@jacobworrel
Copy link
Owner

@gege83 Glad to hear this component is useful for you.

This happens because of the call to scrollToItem here: src/MenuList.tsx:114. This is necessary for the menu to scroll when pressing the down arrow.

I think this is a fairly minor issue, but if you can figure out a fix that doesn't add too much complexity to the code, I'd be happy to accept a PR.

@jacobworrel jacobworrel added bug Something isn't working good first issue Good for newcomers labels May 15, 2022
@sgadman
Copy link

sgadman commented Jun 21, 2022

I opened up a PR for this fix. Would love some feedback on it.

mikkpokk added a commit to mikkpokk/react-windowed-select that referenced this issue Sep 15, 2023
mikkpokk added a commit to mikkpokk/react-windowed-select that referenced this issue Sep 15, 2023
@mikkpokk
Copy link

@jacobworrel I opened PR which solves the issue.

@mikkpokk
Copy link

mikkpokk commented Sep 18, 2023

Who ever lands here and PR is still not merged, feel free to use my forked branch instead.

npm install github:mikkpokk/react-windowed-select#main --save

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

4 participants