alex-saunders / sliding-pages

🎠 A polymer 2.0 element designed for page transitions in a carousel style
https://www.webcomponents.org/element/alex-saunders/sliding-pages
MIT License
10 stars 4 forks source link

Scrolling on mobile #1

Closed Link2Twenty closed 5 years ago

Link2Twenty commented 7 years ago

At the moment you can not scroll vertically on a page when you start scrolling from within the element.

To solve this you need to use setScrollDirection, or at least that's what I did 🙂

Listening for certain gestures controls the scrolling direction for touch input. For example, nodes with a listener for the track event will prevent scrolling by default. Elements can override scroll direction with this.setScrollDirection(direction, node), where direction is one of 'x', 'y', 'none', or 'all', and node defaults to this.

https://www.polymer-project.org/1.0/docs/devguide/gesture-events

alex-saunders commented 7 years ago

@Link2Twenty little confused what you mean by this. Are you saying if the sliding-pages element doesn't fill the whole screen, if you start scrolling within the element, it stops scrolling of the page?

alejost848 commented 7 years ago

It seems that setScrollDirection is gone in 2.0. I found a possible replacement for that called Polymer.Gestures.setTouchAction, but using it like @Link2Twenty did in l2t-paper-slider still produces #2 error.

Polymer.Gestures.addListener(this, 'track', e => this._handleTrack(e));
Polymer.Gestures.setTouchAction(this, "y");

Any ideas guys?