Fixed the autofocus feature so that it correctly updates when clicking focus into a field.