Skip to content

Commit

Permalink
fix for cursor ending up in placeholder after delete click of last se…
Browse files Browse the repository at this point in the history
…lection in multiple chosen
  • Loading branch information
waymondo committed Nov 15, 2012
1 parent 6f12beb commit 35b9863
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions vendor/assets/javascripts/chosen.jquery.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,8 @@ class Chosen extends AbstractChosen
if not @is_disabled
@pending_destroy_click = true
this.choice_destroy $(evt.target)
this.input_blur(evt)
@pending_destroy_click = false
else
evt.stopPropagation

Expand Down
3 changes: 2 additions & 1 deletion vendor/assets/javascripts/lib/abstract-chosen.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class AbstractChosen
@activate_action = (evt) => this.activate_field(evt)
@active_field = false
@mouse_on_container = false
@pending_destroy_click = false
@results_showing = false
@result_highlighted = null
@result_single_selected = null
Expand Down Expand Up @@ -55,7 +56,7 @@ class AbstractChosen
setTimeout (=> this.container_mousedown()), 50 unless @active_field

input_blur: (evt) ->
if not @mouse_on_container
if not @mouse_on_container or @pending_destroy_click
@active_field = false
setTimeout (=> this.blur_test()), 100

Expand Down

0 comments on commit 35b9863

Please sign in to comment.