Ticket #2530129 (closed task)

Reporter


Ben Joffe
Opened: 04/20/11
Last modified: 07/20/12
Status: closed
Type: task
Resolution: invalid

Owner


Derek Gathright
Target Release: 3.6.0
Priority: P3 (normal)
Summary: [Pull Request] - Allow nesting of scrollviews by stopping gesture propagation
Description:

Nesting of scrollviews almost works, except gesture events propagating up the tree cause flicking the inner scrollview to flick the outer scrollview as well (doubtfully a desirable consequence,
especially if both scrollviews are oriented on the same axis). stopPropagation() fixes that, although it is a little aggressive, would be nice to be able to declare event listeners as belonging to a
certain group, that could be stopped selectively.

Type: task Observed in Version: development master
Component: ScrollView Severity: S3 (normal)
Assigned To: Derek Gathright Target Release: 3.6.0
Location: Library Code Priority: P3 (normal)
Tags: pull request, github Relates To:
Browsers: All
URL: https://github.com/benjoffe/yui3/commit/11bc72ab7c81ab3d35d89b42ce751af0651b1728
Test Information:

Change History

Ben Joffe

YUI Contributor

Posted: 04/20/11

Pull Request from benjoffe
Commit: /benjoffe/yui3/commit/11bc72ab7c81ab3d35d89b42ce751af0651b1728
Files modified:

Luke Smith

YUI Contributor

Posted: 04/20/11
  • location changed to Library Code
  • status changed from new to accepted

I'll pass this on to Satyen after your CLA is added.

Luke Smith

YUI Contributor

Posted: 04/20/11

Satyen Desai

YUI Developer

Posted: 04/27/11
  • milestone changed to 3.4.0 PR1
  • status changed from assigned to accepted

I don't think we can outright stopPropagation, so can't pull this in as is, but I'll be looking at simplifying the nested scrollview use case for the 3.4.0pr1 timeframe.

Satyen Desai

YUI Developer

Posted: 04/27/11
  • milestone changed from 3.4.0 PR1 to 3.4.0

Ben Joffe

YUI Contributor

Posted: 04/28/11

I agree, stopPropagation is fairly ruthless, a better solution is probably the following in the _flick and _onGestureMoveStart listeners:

if (e.target.ancestor('.yui3-scrollview') != sv._bb) {
return;
}

If you agree should I submit a new ticket or just change that 'URL' parameter above?

Satyen Desai

YUI Developer

Posted: 06/23/11
  • estimated changed from 0 to 2
  • sprint changed to sprint 3

Tilo Mitra

YUI Developer

Posted: 06/27/11

Tilo Mitra

YUI Developer

Posted: 08/10/11
  • milestone changed from 3.4.0 to 3.5.0
  • status changed from assigned to accepted

Tilo Mitra

YUI Developer

Posted: 08/10/11
  • sprint changed from sprint 3

Tilo Mitra

YUI Developer

Posted: 08/22/11
  • milestone changed from 3.5.0 to 3.4.1

Tilo Mitra

YUI Developer

Posted: 08/24/11

Re-assigning to Satyen due to time constraints.

Satyen Desai

YUI Developer

Posted: 08/24/11
  • milestone changed from 3.4.1 to 3.5.0
  • status changed from assigned to accepted

I've already got my 3.4.1 list sorted out. Will need to push this to 3.5.0.

Ben,

I think the nested scrollview implementation goes a little deeper than just the event prevention. A common use case with nested scrollviews is to have a horizontally nested scrollview inside a vertical one, so in this case the logic to detemine whether to "stop propagation" or not goes a little deeper - where we need to try and determine if the gesture is primarily a horizontal one or a vertical one, before deciding which scrollview needs to respond to it. I'll need to think about this a little more. Putting it on the 3.5.0 timeframe. Let me know if you have feedback/implementation ideas in the meantime and I'll share my WIP as I get something going

Satyen Desai

YUI Developer

Posted: 11/7/11

Derek Gathright

YUI Developer

Posted: 11/9/11
  • sprint changed to sprint 1
  • status changed from assigned to accepted

Derek Gathright

YUI Developer

Posted: 11/9/11
  • sprint changed from sprint 1

Derek Gathright

YUI Developer

Posted: 03/27/12
  • milestone changed from 3.5.0 to 3.6.0

Derek Gathright

YUI Developer

Posted: 07/20/12
  • resolution changed to invalid
  • status changed from accepted to closed

FYI, we did quite a bit of work recently on a dual-axis scrollview & paginator, so ideally, nesting scrollviews will no longer be necessary. These updates do not yet have a specific release to be shipped with, but likely 3.7.0. Work in progress can be found @ https://github.com/derek/scrollview-sandbox/tree/master/dualaxispaginator