 			$lis = $ul = currentEl = null
 			$input = element.find "input"
 
+			# we don't use ng-blur to make sure typeahead can have a custom ng-blur too
+			$input[0].addEventListener "blur", -> hideList()
+			
 			$timeout ->
 				$ul = element.find "ul"
 				$ul.addClass "hide"
 				null
+
+			hideList = -> $lis.removeClass("show").removeClass("active").addClass "hide"
 
 			setCurrent = (direction) ->
 				return unless $ul[0].getElementsByClassName("show")[0]

					when 13, 32 # enter, space
						select(currentEl) if currentEl?
					when 27 # esc
						$lis.removeClass("show").removeClass("active").addClass "hide"
						currentEl = null
					else
						currentEl.className = "show" if currentEl

			select = (el) ->
				$timeout ->
					$input.val(el.innerHTML).triggerHandler("input")
					hideList()
				null
			scope.typeaheadKeydown = (evt) ->
				switch evt.which
