From 816af4425b5dd867dd8378a96c107759054e5e49 Mon Sep 17 00:00:00 2001 From: Igor Vaynberg Date: Mon, 13 Aug 2012 15:27:08 -0700 Subject: [PATCH] fix cursor position in select when opened with a char key press. fixes #323 --- select2.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/select2.js b/select2.js index 79175d17..9647d048 100755 --- a/select2.js +++ b/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