question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[info] Always start at the bottom of the list

See original GitHub issue

Hi! I’m building a chat system using React Virtuoso and I’m using scrollToIndex to scroll right to the bottom of the list, with a tiny delay. This works “ok” but as I said there’s a tiny delay. I was wondering if there’s a way to automatically show the list scrolled at the bottom already?

Thanks!

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:7
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
petyosicommented, Jan 31, 2020

@iJimmyWei Thanks for sharing that! I am working on this feature right now (with a timeline / chat UI in mind), should be available in the upcoming weeks.

3reactions
iJimmyWeicommented, Jan 31, 2020

For anyone looking at this issue when building a “chat” system, one way to get around this is to apply a transformation on the Virtuoso style prop, i.e <Virtuoso style={{rotate(180deg) scaleX(-1)}}> and then apply the same transformation but on the ItemContainer too (so the item is reversed back to be readable again).

The scrollbar itself naturally reverses too (works on mac, chrome and firefox), so you’ll be starting from the bottom. Furthermore, you’ll have to manually invert scrolling. This kind of methodology works well as onEndReached will get called properly when you scroll to the “top”.

The idea was taken from https://facebook.github.io/react-native/docs/flatlist#inverted where they apply a transformation too for their inverted prop.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How can I scroll list keeping items always at the bottom?
I am trying to create an html/css "chat style" ul list that loads all items from the bottom. I have tried several attempts...
Read more >
Video: Drop-down list settings - Microsoft Support
Training: You can use a comma-delimited list, a cell range, or a named range to define the options in a drop-down list. This...
Read more >
position - CSS: Cascading Style Sheets - MDN Web Docs
The position CSS property sets how an element is positioned in a document. The top, right, bottom, and left properties determine the final ......
Read more >
4 shortcuts to get to the bottom of your excel spreadsheet fast
The first shortcut is the 'End' key. This key is located at the bottom right of your keyboard, in between the 'PgDn' and...
Read more >
Customize your Safari settings on iPhone - Apple Support
Customize your start page · Tap the Tabs button , then tap · Scroll to the bottom of the page, then tap Edit....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found