From 03f0e7bb730ebd259a5135741b9080b25d9887bb Mon Sep 17 00:00:00 2001 From: lngc Date: Mon, 17 Jul 2017 16:14:29 +0800 Subject: [PATCH] fix for feature that when input is blur hide the plus/minus button refer to : https://gist.github.com/fatbigbright/4aeacd30373038fcd44d2d348506259e --- bootstrap-number-input.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/bootstrap-number-input.js b/bootstrap-number-input.js index 54a5545..42e46d4 100644 --- a/bootstrap-number-input.js +++ b/bootstrap-number-input.js @@ -37,9 +37,12 @@ var max = self.attr('max'); function setText(n) { - if ((min && n < min) || (max && n > max)) { - return false; - } + // if ((min && n < min) || (max && n > max)) { + // return false; + // } + + if(min && n < min) n = min; + else if(max && n > max) n = max; clone.focus().val(n); return true;