Solution for the problem with drop down list (select box) being unusable

1,402 views
Skip to first unread message

tchiyuan

unread,
Nov 20, 2010, 1:23:50 AM11/20/10
to iScroll
Okay,

I'm using iScroll version 3.7.1. I'm using it for iphone (phonegap)
development. It's a life saver.

However, I was having a problem with iScroll that made drop down lists
unusable when used at the same time.

On Matteo's website I tried one of the suggestions by Udi which was
to:

"Add the following code at the beginning of handleEvent:
var theTarget = e.target;
if (theTarget !== null && theTarget.tagName === ‘SELECT’) {
return false;"

However, that didn't quite work out for me. It made the drop down list
work but iScroll was unusable.

So this is what I did:

In the touchStart function make sure to add the following condition:

if (e.target.tagName != "SELECT")
{
e.preventDefault();
e.stopPropagation();
}

We don't want iScroll to stop the propagation of the event if we
touched on a select box (drop down list). The event can then be
normally propagated and trigger the appropriate behavior on iphone
drop down list ui.

Jones

unread,
Dec 8, 2010, 10:29:55 AM12/8/10
to iScroll
That works great. Thanks a lot!

Hans-Joachim Bolle

unread,
Dec 13, 2010, 2:15:38 PM12/13/10
to iScroll

Hello guys,


I'm joining the iscroll party and have also a lot of issues to
solve :p

I can confirm, that this workaround seems to be fine - at least it
solved my issue.


Hajo

Ari Borchew

unread,
Dec 27, 2010, 1:24:39 PM12/27/10
to iScroll
Good work. Thanks a bunch!

prasadreddy p

unread,
Jul 19, 2012, 1:11:00 AM7/19/12
to isc...@googlegroups.com


Thank you.It's really superb solution.
I'm using iscroll.v4.1.9.
i have modified the code at line 100..the  modified code is

  onBeforeScrollStart: function (e) {
           if (e.target.tagName != "SELECT") {
               e.preventDefault();
               e.stopPropagation();
           }
       },


 It's working fine on Mac OS. 
But in android input type "text" is not allowing me to enter any data.
Please let me know , any one is having solution for this.

Thanks,
Prasad Reddy
Reply all
Reply to author
Forward
0 new messages