Adding preventDefault() for navigation keys