Kaynağa Gözat

allow clearing on backspace as well as delete. fixes #396

Igor Vaynberg 12 yıl önce
ebeveyn
işleme
ab7ab5b3f7
1 değiştirilmiş dosya ile 2 ekleme ve 1 silme
  1. 2 1
      select2.js

+ 2 - 1
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;
                 }