Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why can't I click input?

I'm using iScroll4 plugin (http://cubiq.org/iscroll-4/) to add scrollbar to pages that are longer than 80% of height of the browser's viewport. For some reason when (and only in this case) I add it and try to click on input, it won't select. Only clicking on its label will select input.

What can I do to have iScroll4 and selectable input?

like image 728
Atadj Avatar asked Feb 09 '12 11:02

Atadj


1 Answers

Try this solution

   myScroll = new iScroll('wrapper', {});

   myScroll.options.onBeforeScrollStart = function(e) {                
        var target = e.target;

        while (target.nodeType != 1) target = target.parentNode;
        if (target.tagName != 'SELECT' && target.tagName != 'INPUT' && target.tagName != 'TEXTAREA'){
            e.preventDefault();
        }
   }
like image 187
darryn.ten Avatar answered Sep 28 '22 15:09

darryn.ten