i believe it should be better to listen for the `focus` event to be more reliable here.