Fix #1773 by calling focus in a $timeout