From f7fa1d2a0fd3800e709032970ce7fe4cdd43aba9 Mon Sep 17 00:00:00 2001 From: akudlenok Date: Wed, 21 Feb 2018 09:35:01 +0300 Subject: [PATCH 1/2] Adding a new item by pressing Enter --- coffee/chosen.jquery.coffee | 1 + 1 file changed, 1 insertion(+) diff --git a/coffee/chosen.jquery.coffee b/coffee/chosen.jquery.coffee index 6e1f1ca1296..197406e4ec2 100644 --- a/coffee/chosen.jquery.coffee +++ b/coffee/chosen.jquery.coffee @@ -453,6 +453,7 @@ class Chosen extends AbstractChosen show_create_option: (terms) -> create_option_html = this.get_create_option_html(terms) + this.result_do_highlight $(create_option_html) @search_results.append create_option_html create_option_clear: -> From 57dc33987871f7c74f6ea6736b8a3c1e86c502f7 Mon Sep 17 00:00:00 2001 From: akudlenok Date: Wed, 21 Feb 2018 10:46:45 +0300 Subject: [PATCH 2/2] Adding a new item by pressing Enter --- coffee/chosen.jquery.coffee | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/coffee/chosen.jquery.coffee b/coffee/chosen.jquery.coffee index 197406e4ec2..b831f815f73 100644 --- a/coffee/chosen.jquery.coffee +++ b/coffee/chosen.jquery.coffee @@ -452,8 +452,8 @@ class Chosen extends AbstractChosen @form_field_jq.trigger("chosen:no_results", {chosen:this}) show_create_option: (terms) -> - create_option_html = this.get_create_option_html(terms) - this.result_do_highlight $(create_option_html) + create_option_html = $('
  • ' + @create_option_text + ': "' + terms + '"
  • ') + this.result_do_highlight create_option_html @search_results.append create_option_html create_option_clear: ->