From ce87a7e405795a8b6dcbfa984ed8bc12011a6527 Mon Sep 17 00:00:00 2001 From: FrancYescO Date: Fri, 31 May 2013 00:36:51 +0300 Subject: [PATCH] avoid auto-unselect when coming to the input with tab --- numeric/jquery.numeric.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/numeric/jquery.numeric.js b/numeric/jquery.numeric.js index 417f26c..381faa2 100644 --- a/numeric/jquery.numeric.js +++ b/numeric/jquery.numeric.js @@ -216,8 +216,10 @@ $.fn.numeric.keyup = function(e) } } // set the value and prevent the cursor moving to the end - this.value = val; - $.fn.setSelection(this, carat); + if(this.value!=val){ //avoid auto-unselect when coming to the input with tab + this.value = val; + $.fn.setSelection(this, carat); + } } };