Fix autoscroll not being disabled sometimes

Fixes #2656