From 6a68f35e4f4b12a9e192fffa247af4f13622f579 Mon Sep 17 00:00:00 2001 From: Tony Garlanger Date: Fri, 24 Oct 2014 14:07:14 -0500 Subject: [PATCH] fixing iOS bug There is a bug in iOS when an item is selected, the control behind it is activated --- coffee/chosen.jquery.coffee | 4 ++++ coffee/chosen.proto.coffee | 3 +++ 2 files changed, 7 insertions(+) diff --git a/coffee/chosen.jquery.coffee b/coffee/chosen.jquery.coffee index 4ec7b22f14b..0c8cdebd86d 100644 --- a/coffee/chosen.jquery.coffee +++ b/coffee/chosen.jquery.coffee @@ -362,6 +362,10 @@ class Chosen extends AbstractChosen @form_field_jq.trigger "change", {'selected': @form_field.options[item.options_index].value} if @is_multiple || @form_field.selectedIndex != @current_selectedIndex @current_selectedIndex = @form_field.selectedIndex + + evt.preventDefault() + evt.stopPropagation() + this.search_field_scale() single_set_selected_text: (text=@default_text) -> diff --git a/coffee/chosen.proto.coffee b/coffee/chosen.proto.coffee index 199e2aa8e15..1322ed7a7cb 100644 --- a/coffee/chosen.proto.coffee +++ b/coffee/chosen.proto.coffee @@ -358,6 +358,9 @@ class @Chosen extends AbstractChosen @form_field.simulate("change") if typeof Event.simulate is 'function' && (@is_multiple || @form_field.selectedIndex != @current_selectedIndex) @current_selectedIndex = @form_field.selectedIndex + evt.preventDefault() + evt.stopPropagation() + this.search_field_scale() single_set_selected_text: (text=@default_text) ->