Commit d1ad6390 authored by Alfredo Sumaran's avatar Alfredo Sumaran

Do not fire blur event when clicking a suggestion

parent 5f4ce722
...@@ -145,7 +145,10 @@ class @SearchAutocomplete ...@@ -145,7 +145,10 @@ class @SearchAutocomplete
@clearInput.on 'click', @onClearInputClick @clearInput.on 'click', @onClearInputClick
onDocumentClick: (e) => onDocumentClick: (e) =>
if not $.contains(@dropdown[0], e.target) and @isFocused # If clicking outside the search box
# And search input is not focused
# And we are not clicking inside a suggestion
if not $.contains(@dropdown[0], e.target) and @isFocused and not $(e.target).parents('ul').length
@onSearchInputBlur() @onSearchInputBlur()
enableAutocomplete: -> enableAutocomplete: ->
...@@ -290,5 +293,4 @@ class @SearchAutocomplete ...@@ -290,5 +293,4 @@ class @SearchAutocomplete
$el.removeClass('is-active') $el.removeClass('is-active')
@disableAutocomplete() @disableAutocomplete()
@onSearchInputFocus()
@searchInput.val('').focus() @searchInput.val('').focus()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment