AppFlowy-IO/appflowy-board

scroll in group card

Lamgiaosu1805 opened this issue · 1 comments

Every time setState(), the group card is scrolled to the top

Hello

I found out why is it happening

  • First of all, a new ScrollController is created for the ReorderFlex widget in the _AppFlowyBoardContent. We can store ScrollControllers for each group in a map
  • However this alone won't resolve the issue because ReorderFlex widget reads the scroll position of the nearest scrollable (here is the code) and sets it to the scroll controller. Consequently, the reorder flex of the group (the red ReorderFlex 1 on screenshot) reads the scroll position of the columns' reorder flex (the green ReorderFlex 2 on screenshot), leading to incorrect behavior. When I comment out the line from the referenced code and apply the initial fix, everything works correctly

What I'm asking is, what should I do regarding the second issue? Can I simply remove all the scroll position-related code from the didChangeDependencies method?

Screenshot 2024-01-26 at 16 14 58