I use phoneGap 1.1.0 and iScroll 4.1.9 to build a iPhone & android app.
On android- scroll textarea work fine.
But, on iPhone the textarea is not scrolling.
Two fingers scrolling doesn't work on my iPhone 3GS (iOS 5.0.1)
Any one has solution?
thanks.
-
I would be interested in this as well. – J. K. Feb 13 '12 at 10:07
2 Answers
I know it's a bit late but I found a solution:
This answer to this question stops the UIScrollView in UIWebView from scrolling: Disable Scroll on a UIWebView allowed?
I added this code in the viewDidLoad function of MainViewController.m
for (UIView *view in webview.subviews) {
if ([view isKindOfClass:[UIScrollView class]]) {
UIScrollView *scrollView = (UIScrollView *)view;
scrollView.scrollEnabled = NO;
}
}
Next issue is preventing iScroll from handling events on TextArea, for this you need to get the debug version of iscroll so you can change the code (3rd line):
handleEvent: function (e) {
var that = this;
if(e.srcElement.tagName == "TEXTAREA") return; // don't handle textarea
switch(e.type) {
case START_EV:
if (!hasTouch && e.button !== 0) return;
that._start(e);
break;
case MOVE_EV: that._move(e); break;
case END_EV:
case CANCEL_EV: that._end(e); break;
case RESIZE_EV: that._resize(); break;
case WHEEL_EV: that._wheel(e); break;
case TRNEND_EV: that._transitionEnd(e); break;
}
}
and also don't preventDefault for your textarea using similar if.
This combination worked for me.
The -webkit and overflow css tags just make it look nicer.
Uh, and on ios 4 the scrolling is done by two fingers and not by one.
The problem stems from what I think you're trying to do and disable the "frame" of the app from scrolling offscreen with:
document.addEventListener('touchmove', function(e) {
e.preventDefault();
}, false);
Unfortunately, I've tried every combination I can think of including the new -webkit-overflow-scrolling: touch
CSS property (to no avail). Haven't found a solution yet.

- 141
- 2
- 7
-
Thanks, It's actually my issue. but i need it to prevent whole page scroll when scrolling over top or bottom of textarea. – qwerty Feb 20 '12 at 10:20