Fix auto-scroll from getting stuck on some tools
(cherry picked from commit f2581dcdf752c02ccfd27d43521b90658f07f3bc)