Permalink
Browse files

fix issue with undefined variable

  • Loading branch information...
1 parent 39dd033 commit 88bcf6adbc4aa117001799ae009e4588e10cf074 @koenpunt committed Apr 7, 2017
Showing with 2 additions and 1 deletion.
  1. +2 −1 coffee/lib/abstract-chosen.coffee
@@ -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
@@ -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

0 comments on commit 88bcf6a

Please sign in to comment.