From ab7ab5b3f7fb9985b11ad8af20738ac3466426b8 Mon Sep 17 00:00:00 2001 From: Igor Vaynberg Date: Thu, 13 Sep 2012 00:09:17 -0700 Subject: [PATCH] allow clearing on backspace as well as delete. fixes #396 --- select2.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/select2.js b/select2.js index ceb09281..c9c97526 100644 --- a/select2.js +++ b/select2.js @@ -1543,10 +1543,11 @@ return; } - if (e.which == KEY.DELETE) { + if (e.which == KEY.DELETE || e.which == KEY.BACKSPACE) { if (this.opts.allowClear) { this.clear(); } + killEvent(e); return; }