Fix weird focus issue

Closes #2421