h5bp/mobile-boilerplate

MBP.preventScroll(); breaks the slider in <input type="range">

cobookman opened this issue · 1 comments

Not sure if this was a design decision, but MBP.preventScroll() also prevents the slider of from sliding left to right.

Here is the code fix which I've implemented

 $(document).ready(function() {  
        var ranges = document.querySelectorAll("input[type=range]");
        var rangeIds  = new Array();
        for(var i=0; i<ranges.length; i++) { 
            rangeIds.push(ranges[i].id); 
        }
        document.addEventListener("touchmove", function(e) {
             if(jQuery.inArray(e.target.id, rangeIds)==-1) {
                   e.preventDefault();
             }
        }, false);
      });

Thanks - yes we should do a check. Will look to use a fix that does not depend on jQuery however