From 9242a83421611de3a48c99fe6fa3299cce226d92 Mon Sep 17 00:00:00 2001 From: brunoais Date: Thu, 17 Dec 2015 15:43:35 +0000 Subject: [PATCH] Add support to interactions with the input element (when input event happens) partly closes #47 #152 --- src/rangeslider.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/rangeslider.js b/src/rangeslider.js index df7f25f..1068742 100644 --- a/src/rangeslider.js +++ b/src/rangeslider.js @@ -268,7 +268,7 @@ this.$document.on(this.startEvent, '#' + this.identifier + ':not(.' + this.options.disabledClass + ')', this.handleDown); // Listen to programmatic value changes - this.$element.on('change.' + this.identifier, function(e, data) { + this.$element.on('change.' + this.identifier + ' input.' + this.identifier, function(e, data) { if (data && data.origin === _this.identifier) { return; } @@ -319,6 +319,8 @@ // If we click on the handle don't set the new position if ((' ' + e.target.className + ' ').replace(/[\n\t]/g, ' ').indexOf(this.options.handleClass) > -1) { + this.$element.focus(); + e.preventDefault(); return; }