Skip to content

Commit

Permalink
add shortcut for deselect
Browse files Browse the repository at this point in the history
pressing delete will deselect when allowed

fixes #994
  • Loading branch information
koenpunt committed Oct 15, 2016
1 parent f2fe103 commit 017dafe
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion coffee/lib/abstract-chosen.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,11 @@ class AbstractChosen
evt.preventDefault()
this.keydown_arrow()
break
when 46 # delete
if @allow_single_deselect and not @results_showing
evt.preventDefault()
this.results_reset()
break

keyup_checker: (evt) ->
stroke = evt.which ? evt.keyCode
Expand All @@ -290,7 +295,7 @@ class AbstractChosen
when 27 # escape
this.results_hide() if @results_showing
break
when 9, 16, 17, 18, 38, 40, 91
when 9, 16, 17, 18, 38, 40, 46, 91
# don't do anything on these keys
else
this.results_search()
Expand Down

0 comments on commit 017dafe

Please # to comment.