Bug 393692 - [iOS]: When selecting a list item while scrolling, the wrong one gets selected
Summary: [iOS]: When selecting a list item while scrolling, the wrong one gets selected
Status: CLOSED WORKSFORME
Alias: None
Product: RAP
Classification: RT
Component: RWT (show other bugs)
Version: 1.5   Edit
Hardware: PC iOS
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: needinfo
Depends on:
Blocks:
 
Reported: 2012-11-06 11:37 EST by Claudio Guglielmo CLA
Modified: 2014-12-04 09:59 EST (History)
1 user (show)

See Also:


Attachments
Sample to reproduce ios bug (237.11 KB, application/x-zip-compressed)
2012-11-06 11:37 EST, Claudio Guglielmo CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Claudio Guglielmo CLA 2012-11-06 11:37:32 EST
Created attachment 223257 [details]
Sample to reproduce ios bug

I have a list with a ISelectionChangedListener attached. If I scroll the list on iPhone (TouchScrolling is enabled) and select any item while it's still scrolling, the selection event will be fired for the wrong item. If I wait until scrolling has finished, the target will be correct.

Problem is in MobileWebkitSupport.js. The TouchEvent in handleTouchStart and  handleTouchEnd contains the wrong target. Since it works with Android (4) but not with ios 5 and 6, I reported a bug to apple.

I'm wondering if there is a workaround. Following thinks come to my mind:
1. Don't send any events while scrolling. Touching the screen while it's scrolling should ONLY stop the scrolling, not more. Native ios apps work like this. Unfortunately I don't know if it's possible to detect if scrolling has finished.
2. Get the element by elementFromPoint instead of using target. I tried this, but this does only work on touchend, not on touchstart -> useless.
3. Completely forget webkit-overflow-scroll: touch and use iScroll instead. Although it works with iScroll, it's not so smooth and scrollbars are missing.
4. ???

See the attached file with a sample and screenshot.
Comment 1 Ivan Furnadjiev CLA 2014-12-04 06:37:11 EST
Claudio, is this bug still current? Is it reproducible with latest iOS version 8.1.1?
Comment 2 Claudio Guglielmo CLA 2014-12-04 09:57:23 EST
Seems to be fixed with iOS 8.1.1, even though the bug at apple is still open.

Nevertheless I think we'll stick with the workaround provided by Tim -> Touching en element while scrolling should not execute its action but rather just stop scrolling.

-> Bug may be closed.
Comment 3 Ivan Furnadjiev CLA 2014-12-04 09:59:31 EST
(In reply to Claudio Guglielmo from comment #2)
> Seems to be fixed with iOS 8.1.1, even though the bug at apple is still open.
> Bug may be closed.