fixed input focus and highlighting

(needs some refactoring though)