Fixes bug with shortcuts enabled when the user is writing in a text field.