Enabling native overflow scrolling on supported platforms.

70 views
Skip to first unread message

Martin Kleinschrodt

unread,
May 7, 2014, 11:09:24 AM5/7/14
to enyo-dev...@googlegroups.com
I recently tried to use native overflow scrolling in an Enyo application on iOS7 and KitKat via '-webkit-overflow-scrolling: touch' and was surprised to see that it didn't work. Digging into enyo core, I found this (https://github.com/enyojs/enyo/blob/master/source/touch/touch.js#L34-L39):

// prevent default document scrolling if enyo.bodyIsFitting == true
// avoid window scrolling by preventing default on this event
// note: this event can be made unpreventable (native scrollers do this)
if (enyo.bodyIsFitting) {
    inEvent.preventDefault();
}

Is there any specific reason for this, apart from preventing the overflow scrolling on the document itself? I feel like this should be removed, if only to allow people to use native overflow scrolling if they choose to do so.

Ben Combee

unread,
May 7, 2014, 11:18:22 AM5/7/14
to enyo-dev...@googlegroups.com
IIRC (and it's been a while), one of the problems with the native scroller is that it didn't provide timely events about the scroll position, which meant it wasn't usable with our List implementation as the list didn't get notified to refresh it's visible set of elements.  That shouldn't prevent its use for content you've fully generated, but someone doing active dev may be able to provide more color.


--
You received this message because you are subscribed to the Google Groups "Enyo Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to enyo-developme...@googlegroups.com.
To post to this group, send email to enyo-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/enyo-development/10cce77f-0116-4b67-9f4d-da03c760779a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Martin Kleinschrodt

unread,
May 7, 2014, 11:25:00 AM5/7/14
to enyo-dev...@googlegroups.com
Great to see you're still watching the mailing list, Ben! Yeah, I'm aware of the list problems but as you said that's really no reason to prevent the default behavior of the touchmove event.

Martin Kleinschrodt

unread,
May 13, 2014, 8:19:54 AM5/13/14
to enyo-dev...@googlegroups.com
Really? Ben's the only one who's watching the mailing list? That's kinda sad...

Cole Davis

unread,
May 13, 2014, 5:02:19 PM5/13/14
to enyo-dev...@googlegroups.com
I think Ben's answer is very accurate. The code you are referring to was added back in early 2012 (before I was on the team) and was solving a compatibility issue that may/may-not be as large a factor for modern browsers. I tracked the path of code relying on the behavior and it looks like having a way to disable it could be useful but would probably disable other features of non-native scrollers potentially. The impacts across the board would need to be traced – specifically TouchScrollStrategy.

Cheers,

Cole

Reply all
Reply to author
Forward
0 new messages