When the buffer list sidebar is long and does not fit to the page, scroll the current buffer selection into view.
Scroll active buffer into view #14
petteri/gamja:scroll_sidebar into master
With React, querying the DOM directly is not something we should be doing. In addition, doing DOM manipulation like this every time the render function is called will not work reliable (for instance it'll scroll to the active buffer item when it's marked as read/unread, even if the user has scrolled away).
I think we need to use createRef() to store a reference to the item, and use the componentDidUpdate() lifecycle method to scroll if the item just became active.
Oops, I didn't notice the automatic scrolling since I'm only using the keyboard. Thanks for the insight! I'll see if I can rework the patch.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.
No due date set.
No dependencies set.
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?