From 289ca48fda12c4d1a946a58555536d261456e2f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Igor=20de=20Oliveira=20S=C3=A1?= Date: Sat, 5 Jan 2013 11:03:39 -0200 Subject: [PATCH] Update numeric/jquery.numeric.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When I have a field set with many inputs, it's boring when I am pressing tab key and have to select all manually. Then, if the key pressed were tab, I let all selection value happen.  --- numeric/jquery.numeric.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/numeric/jquery.numeric.js b/numeric/jquery.numeric.js index 417f26c..3efbe9b 100644 --- a/numeric/jquery.numeric.js +++ b/numeric/jquery.numeric.js @@ -217,7 +217,13 @@ $.fn.numeric.keyup = function(e) } // set the value and prevent the cursor moving to the end this.value = val; - $.fn.setSelection(this, carat); + if (e.keyCode==9) // if keyCode == tab, select all value. It's better. + { + this.select(); + } + else { + $.fn.setSelection(this, carat); + } } };