jacobworrel / react-windowed-select

An integration of react-window with react-select to efficiently render large lists.
MIT License
142 stars 38 forks source link

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

Open gege83 opened 3 years ago

gege83 commented 3 years ago

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

reproduce:

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

alternative

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

jacobworrel commented 3 years ago

@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.

sgadman commented 2 years ago

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

mikkpokk commented 1 year ago

@jacobworrel I opened PR which solves the issue.

mikkpokk commented 1 year ago

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