Autofocus fix

Fix for autofocusing on input fields with autofocus tag. Also added
optional activate event to override.