webscopeio / react-textarea-autocomplete

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

Add parameter to prevent scrollintoView from aligning to top #75

Closed diogeneshamilton closed 6 years ago

diogeneshamilton commented 6 years ago

Was having many issues with the alignTop functionality, and so this param disables it which is less jarring. Still allows the selected item to scroll into view correctly.

Documentation here: https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView

jukben commented 6 years ago

Sorry about it! I've tried to test it and in my case it was ok. I want to actually play with this idea https://github.com/webscopeio/react-textarea-autocomplete/issues/70#issuecomment-403223948 and I'm wondering, maybe it would make a sense to turn on this feature just on demand. I could introduce a new special prop scrollIntoView, what do you think?

diogeneshamilton commented 6 years ago

I think that could work, at least in the short run for me. I would also be interested in opening up the scrollintoView settings, so maybe the prop can be accepted as a boolean or an object or separate props? Then people can customize it however they want.

jukben commented 6 years ago

I'm going to close this in favor of https://github.com/webscopeio/react-textarea-autocomplete/pull/76 I hope you will like it!

diogeneshamilton commented 6 years ago

I think that'll work, thanks!

jukben commented 6 years ago

Feel free to test it https://github.com/webscopeio/react-textarea-autocomplete/releases/tag/v2.3.0 👍