Explorar o código

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

Igor Vaynberg %!s(int64=12) %!d(string=hai) anos
pai
achega
ab7ab5b3f7
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  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;
                 }