소스 검색

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

Igor Vaynberg 12 년 전
부모
커밋
ab7ab5b3f7
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  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;
                 }