react-ui icon indicating copy to clipboard operation
react-ui copied to clipboard

`ScrollView` prop `autoScroll: detectEnd` race condition

Open mbohal opened this issue 5 months ago • 0 comments

Originally reported in https://github.com/react-ui-org/react-ui/issues/501

Steps to reproduce:

  1. in the documentation go to the Auto Scrolling section
  2. select the option when end is detected
  3. click on the Add text button to the point where the element scrolls
  4. start clicking on Add text button as fast as you can several times
  5. after a while, auto scroll stops working

https://github.com/user-attachments/assets/346aef66-0d7f-4173-bba7-173a3469c7e4

Relevant comment: https://github.com/react-ui-org/react-ui/issues/501#issuecomment-3018784601

I think the issue lies in a race condition in the else if (!isScrolledAtEnd || isAutoScrollInProgress) condition, but I couldn't think of a satisfactory fix.

mbohal avatar Jul 01 '25 17:07 mbohal