Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8897575
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T00:22:47+00:00 2026-06-15T00:22:47+00:00

I’m building a mobile app that targets Android 2.2+, Blackberry 9+ and iOS 4+.

  • 0

I’m building a mobile app that targets Android 2.2+, Blackberry 9+ and iOS 4+. In our stack we are using Phonegap, jQuery and iScroll (amongst others).

One of our app screens looks like this (text redacted for anonymity) – running in the iOS 5 simulator’s Safari.

App Screenshot

As you can see, this is a typical input screen with a fixed header, and multiple block-level form elements stretching the full with of the device screen, less padding.

As I mentioned, our app uses iScroll. We’re initialising it on this page using the following code (taken from the iScroll ‘forms’ sample).

// ...

window.scroller = new iScroll(id, {
    useTransform: 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();
        }
    }
});

// Disable touch scrolling (Req'd for iScroll)
window.document.addEventListener('touchmove', function(e) {
    e.preventDefault();
}, false);

// ...

On this screen, I’ve noticed that the content scrolls fine when the user touches any part of the background, but doesn’t scroll when you begin the scroll gesture (swiping up or down) by touching one of the input elements. As you can understand this essentially makes this screen impossible to use, hence me looking for a fix.

I’ve since found the culprit line in iScroll;

if (nodeName == "TEXTAREA" || nodeName == "INPUT" || nodeName == "SELECT" ) return; 

(179 in iscroll.js), an open issue for this bug with a claimed fix, and one pull request that claims to fix it, however the author of the bug seems to have incorrect line numbers, preventing me from attempting that fix, and the mentioned pull request doesn’t work for me (tested on iOS 5.1, Android 4.0.4).

My question – is there some way to allow a user to scroll (using iScroll) when touching an input element? If not, iScroll is completely useless in cases like this. At the moment, I’m looking at either

  • Using the Overthrow shim that claims to have identical functionality to iScroll – however this isn’t a great option due to various issues with Android – one of our key platforms.
  • Doing away with iScroll and loosing my fixed header.

It’s 2012 – do we still not have a way to do this on Mobile browsers?!?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T00:22:48+00:00Added an answer on June 15, 2026 at 12:22 am

    I had exactly the same problem and used the following when I set up my iScroll:

    var ISCROLL_MOVE;
    
    var ISCROLL_MOVE_LIMIT=10;
    
    // ... functions to include when you set up your iScroll
    onScrollStart: function(e) {
                    ISCROLL_MOVE=0;
                },
                onScrollMove: function(e) {
                    ISCROLL_MOVE_LIMIT++;
                }
    

    Then when you have any form elements in your iScroll, e.g.:

    var selectField = document.getElementById('mySelectField');
    
    selectField.addEventListener('touchend' /*'mousedown'*/, function(e) {
    
            if (SCROLL_MOVE<SCROLL_MOVE_LIMIT)
                this.focus();
    
        }, false);
    

    Note the action is on a touch end event, and it allows for scrolling iScroll pages when the user touches on a form element – basically it measures the amount of scrolling ( or not ) which the user is making ( the amount of SCROLL_MOVE ). If its more than 10 ( the SCROLL_MOVE_LIMIT seems like a good number to me ) then the field won’t grab focus , otherwise it will.

    Let me know if you need more detail.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We're building an app, our first using Rails 3, and we're having to build
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I am reading a book about Javascript and jQuery and using one of the
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
I am using Paperclip to handle profile photo uploads in my app. They upload
Let's say I'm outputting a post title and in our database, it's Hello Y&#8217;all
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I've got a string that has curly quotes in it. I'd like to replace

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.