webscopeio / react-textarea-autocomplete

📝 React component implements configurable GitHub's like textarea autocomplete.
MIT License
451 stars 80 forks source link

scroll behavior not working for me #201

Open haveanicedavid opened 4 years ago

haveanicedavid commented 4 years ago

Hi again! I'm having trouble getting the scroll behavior to work. I've been trying to troubleshoot but am struggling a bit.

It looks like the container HTMLDivElement being referenced to scroll (where you're setting the scrollTop) is the container div (which dropdownClassname references), however the actual overflow & scroll behavior occurs within the child ul (which the listClassName property references).

Is it possible that the dropdownRef passed to _dropdownScroll() should point to the UL which holds the list?

I can take a whack at changing it later if you'd like, but I figure you know the code better than me so it's worth asking 😄

Loving the lib. Thanks again for your help

jukben commented 4 years ago

Oh, my, that code is actually rusty as hell 😅.

Can you create some repro? https://codepen.io/jukben/pen/poygeKK I tried this one, this actually works as intended I hope.

Unfortunately, I don't have much time to maintain this library. The whole codebase it's literally begging for rewrite (which won't happen).

jngbng commented 3 years ago

I have the similar problem. When I press down arrow keyboard, suggestion dropdown doesn't scroll, while I can scroll it with mouse (trackpad.) I resolved it by changing style of dropdown (Autocomplete).

<ReactTextareaAutocomplete
  ...
  dropdownStyle={{
    maxHeight: 100,
    overflow: "auto",
 }}
/>