Skip to content

Commit

Permalink
fix issue with undefined variable
Browse files Browse the repository at this point in the history
  • Loading branch information
koenpunt committed Apr 7, 2017
1 parent 39dd033 commit 88bcf6a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion coffee/lib/abstract-chosen.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ class AbstractChosen
searchText = this.get_search_text()
escapedSearchText = searchText.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&")
regex = this.get_search_regex(escapedSearchText)
exactRegex = new RegExp("^#{escapedSearchText}$")
highlightRegex = this.get_highlight_regex(escapedSearchText)

for option in @results_data
Expand All @@ -199,7 +200,7 @@ class AbstractChosen
option.search_match = this.search_string_match(option.search_text, regex)
results += 1 if option.search_match and not option.group

exact_result = exact_result || eregex.test option.html
exact_result = exact_result || exactRegex.test option.html

if option.search_match
if searchText.length
Expand Down

0 comments on commit 88bcf6a

Please sign in to comment.