소스 검색

fix cursor position in select when opened with a char key press. fixes #323

Igor Vaynberg 12 년 전
부모
커밋
816af4425b
1개의 변경된 파일2개의 추가작업 그리고 0개의 파일을 삭제
  1. 2 0
      select2.js

+ 2 - 0
select2.js

@@ -1515,6 +1515,8 @@
                     keyWritten = keyWritten.toUpperCase();
                 }
 
+                // focus the field before calling val so the cursor ends up after the value instead of before
+                this.search.focus();
                 this.search.val(keyWritten);
 
                 // prevent event propagation so it doesnt replay on the now focussed search field and result in double key entry