petyosi / react-virtuoso

The most powerful virtual list component for React
https://virtuoso.dev
MIT License
5.13k stars 299 forks source link

[BUG] followOutput doesn't scroll to bottom #1092

Closed biscuitWizard closed 3 months ago

biscuitWizard commented 3 months ago

Describe the bug

When followOutput={true} is defined, per the docs, every new 'Item' should cause the window to scroll to the bottom. I'm seeing two issues:

  1. Intermittently Virtuoso doesn't scroll at all (in the case of many items being added at the same time)
  2. Virtuoso only scrolls to the last index - 1

2 is the much bigger issue; it scrolls to exactly the second to last element.

Reproduction

Visible in https://github.com/Torchship/dome-client.js/tree/vite ; clone the vite branch

To Reproduce Steps to reproduce the behavior:

  1. Type 'MSSP-REQUEST' into the input box
  2. Hit Enter
  3. Repeat steps 1 & 2 until the buffer overflows
  4. See scroll acts inconsistently

Desktop (please complete the following information):

Additional context I've stripped down the formatting and code around Virtuoso to as close as the examples for 'chat like' programs as much as I possibly can.

petyosi commented 3 months ago

Reproduce the problem in a code sandbox without the irrelevant parts and external dependencies. I'm closing this, as usually people don't come back.

biscuitWizard commented 3 months ago

I can see why this bug keeps popping up and remaining unresolved if that's the attitude lol.