From: Daniel Ruf Date: Thu, 29 Mar 2018 19:08:13 +0000 (+0200) Subject: fix: listen for the enter key and trigger a change to emulate change event in IE X-Git-Tag: v6.6.0~3^2~254^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=edf6f79ff;p=thirdparty%2Ffoundation%2Ffoundation-sites.git fix: listen for the enter key and trigger a change to emulate change event in IE --- diff --git a/js/foundation.slider.js b/js/foundation.slider.js index 48818c26f..67dfeb8d0 100644 --- a/js/foundation.slider.js +++ b/js/foundation.slider.js @@ -460,6 +460,16 @@ class Slider extends Plugin { curHandle, timer; + // IE only triggers the change event when the input loses focus which strictly follows the HTML specification + // listen for the enter key and trigger a change + // @see https://html.spec.whatwg.org/multipage/input.html#common-input-element-events + this.inputs.off('keyup.zf.slider').on('keyup.zf.slider', function (e) { + if(e.keyCode == 13) { + var idx = _this.inputs.index($(this)); + _this._handleEvent(e, _this.handles.eq(idx), $(this).val()); + } + }); + this.inputs.off('change.zf.slider').on('change.zf.slider', function(e) { var idx = _this.inputs.index($(this)); _this._handleEvent(e, _this.handles.eq(idx), $(this).val());