Handle case where focus is quickly removed.

Couldn’t use `:focus` because of some issues with phantomjs. :(

Closes #232