Search code examples
androidiscroll

select box not working with iscroll4


Select box when used with iscroll4 is not working properly in htc wildfire(Android version 2.2)(screen resolution 240x320) ,htc legend (2.1)(320x480) ..Is this a problem with iscroll or select box or OS version? Its working properly for same resolutions in higher android versions and in higher screen resolutions in these same OS versions.. I've alreday tried solutions from

combo box not working after load/use iscroll in page

iScroll 4 not working with form <select> element iPhone Safari and Android browser

But didnt get my problem solved.. can anyone help..?


Solution

  • You just need to change this line in the loader of the iscroll:

    Change this line:

    myScroll = new iScroll('wrapper');
    

    For this:

    myScroll = new iScroll('wrapper', {
    useTransform: true,
    zoom: false,
    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();
       }
    });