Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Commit selected element along with the index on change event #2971

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions coffee/chosen.jquery.coffee
Expand Up @@ -398,7 +398,7 @@ class Chosen extends AbstractChosen
this.results_hide()
this.show_search_field_default()

this.trigger_form_field_change selected: @form_field.options[item.options_index].value if @is_multiple || @form_field.selectedIndex != @current_selectedIndex
this.trigger_form_field_change selected: @form_field.options[item.options_index].value, selected_element: @form_field.options[item.options_index] if @is_multiple || @form_field.selectedIndex != @current_selectedIndex
@current_selectedIndex = @form_field.selectedIndex

evt.preventDefault()
Expand Down Expand Up @@ -426,7 +426,7 @@ class Chosen extends AbstractChosen
this.result_clear_highlight()
this.winnow_results() if @results_showing

this.trigger_form_field_change deselected: @form_field.options[result_data.options_index].value
this.trigger_form_field_change deselected: @form_field.options[result_data.options_index].value, deselected_element: @form_field.options[result_data.options_index]
this.search_field_scale()

return true
Expand Down