Skip to content
This repository has been archived by the owner on May 30, 2022. It is now read-only.

Commit

Permalink
fix(macAutocomplete): Fixed dropdown not hiding when no item is returned
Browse files Browse the repository at this point in the history
Fixes #182
  • Loading branch information
adrianlee44 committed Sep 21, 2014
1 parent 83fa97b commit f5dec05
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/directives/autocomplete.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,8 @@ angular.module("Mac").directive "macAutocomplete", [
Update list of items getting passed to menu
@param {Array} data Array of data
###
updateItem = (data = []) ->
if data.length > 0
updateItem = (data) ->
if data?.length > 0
currentAutocomplete = data

$menuScope.items = data.map (item) ->
Expand All @@ -256,6 +256,9 @@ angular.module("Mac").directive "macAutocomplete", [

appendMenu positionMenu

else
reset()

###
@function
@name getData
Expand Down

0 comments on commit f5dec05

Please sign in to comment.