added autofocus to the input element

only if autofocus setting is true (added the setting with default as true also)