Scroll to the top after switching dir

Fixes #7061