Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Clearing single select using delete key does not work on macs #396

pkmiec opened this Issue · 6 comments

3 participants


Select2 seems is very interesting as it supports more use-cases than Chosen. One of the things I've always found awkward with Chosen (and it seems to be the same with Select2) is how a single select is cleared. My understanding is that the only way for a user to clear a single select is to use the mouse to click on the 'x'. And in order for the 'x' to show up in the first place, I need to pass the 'allowClear' option to select2.

Two questions:

  • is there a way for the user to clear using only the keyboard? Perhaps by pressing delete when select2 is collapsed or always showing the empty option when select2 is expanded
  • can select2 recognize that the select contains an empty option and set allowClear accordingly?

This may not seem like a big deal, however, the users of my application perform lots of data entry and therefore are very keyboard-centric.


You should be able to clear the selected option using the delete key, but I cannot verify that it still works.


still works.

@ivaynberg ivaynberg closed this

can select2 recognize that the select contains an empty option and set allowClear accordingly?

you have to specify allowClear manually. an empty option does not necessarily imply that the box can be cleared, it may simply be a valid empty option.


Hmm .. I'm looking at on OS X in firefox and chrome.

I tab onto the field, hit down arrow (which opens up the select) and hit enter. This selects Alaska and keeps the field focused. Hitting delete for me opens up the select.

Is the delete behavior different on OS X vs Windows? or am I misunderstanding how to clear the field with the delete key?


yes, behavior is different on OSX. on all other systems the key that is called delete on the mac is called backspace. ive added code to allow the clearing to happen when either delete or backspace is pressed, so it should now be consistent across platforms.


Cool. thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.