AutoScroll.canScroll is only assigned in initState and as such its AutoScrollMouseListener is permanently in either an enabled or disabled state.
Consider an expandable list that initially starts collapsed and fits fully on the screen but is later expanded to take up more space. While the user can then scroll with the mouse wheel, AutoScroll does not react to this change. The opposite also applies if this list starts initially expanded and doesn't fit in the window but is then collapsed. Similar effects can even be observed if a list is static but the app window is dragged to change in size.
Moving this assignment from initState to build seems to address this issue.
AutoScroll.canScrollis only assigned ininitStateand as such itsAutoScrollMouseListeneris permanently in either an enabled or disabled state.Consider an expandable list that initially starts collapsed and fits fully on the screen but is later expanded to take up more space. While the user can then scroll with the mouse wheel, AutoScroll does not react to this change. The opposite also applies if this list starts initially expanded and doesn't fit in the window but is then collapsed. Similar effects can even be observed if a list is static but the app window is dragged to change in size.
Moving this assignment from
initStatetobuildseems to address this issue.