Fire the change event when deselecting a value.
This commit is contained in:
parent
b7a9b218fb
commit
953d3baa4f
6 changed files with 8 additions and 2 deletions
|
@ -450,6 +450,7 @@
|
||||||
this.selected_item.find("span").text(this.default_text);
|
this.selected_item.find("span").text(this.default_text);
|
||||||
this.show_search_field_default();
|
this.show_search_field_default();
|
||||||
$(evt.target).remove();
|
$(evt.target).remove();
|
||||||
|
this.form_field_jq.trigger("change");
|
||||||
if (this.active_field) {
|
if (this.active_field) {
|
||||||
return this.results_hide();
|
return this.results_hide();
|
||||||
}
|
}
|
||||||
|
|
2
chosen/chosen.jquery.min.js
vendored
2
chosen/chosen.jquery.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -440,6 +440,9 @@
|
||||||
this.selected_item.down("span").update(this.default_text);
|
this.selected_item.down("span").update(this.default_text);
|
||||||
this.show_search_field_default();
|
this.show_search_field_default();
|
||||||
evt.target.remove();
|
evt.target.remove();
|
||||||
|
if (typeof Event.simulate === 'function') {
|
||||||
|
this.form_field.simulate("change");
|
||||||
|
}
|
||||||
if (this.active_field) {
|
if (this.active_field) {
|
||||||
return this.results_hide();
|
return this.results_hide();
|
||||||
}
|
}
|
||||||
|
|
2
chosen/chosen.proto.min.js
vendored
2
chosen/chosen.proto.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -364,6 +364,7 @@ class Chosen
|
||||||
@selected_item.find("span").text @default_text
|
@selected_item.find("span").text @default_text
|
||||||
this.show_search_field_default()
|
this.show_search_field_default()
|
||||||
$(evt.target).remove();
|
$(evt.target).remove();
|
||||||
|
@form_field_jq.trigger "change"
|
||||||
this.results_hide() if @active_field
|
this.results_hide() if @active_field
|
||||||
|
|
||||||
result_select: (evt) ->
|
result_select: (evt) ->
|
||||||
|
|
|
@ -359,6 +359,7 @@ class Chosen
|
||||||
@selected_item.down("span").update(@default_text)
|
@selected_item.down("span").update(@default_text)
|
||||||
this.show_search_field_default()
|
this.show_search_field_default()
|
||||||
evt.target.remove()
|
evt.target.remove()
|
||||||
|
@form_field.simulate("change") if typeof Event.simulate is 'function'
|
||||||
this.results_hide() if @active_field
|
this.results_hide() if @active_field
|
||||||
|
|
||||||
result_select: (evt) ->
|
result_select: (evt) ->
|
||||||
|
|
Loading…
Add table
Reference in a new issue