GeoloeG / iron-swipeable-pages

[Polymer 1.x] Element that enables switching between different pages by swiping gesture.
MIT License
49 stars 25 forks source link

How to prevent Edge Swipe event? #30

Closed JohnsonChung closed 8 years ago

JohnsonChung commented 8 years ago

Hello, MeTaNoV I use this element building an app with <paper-drawer-panel>, that as follow

<paper-drawer-panel>
  <div drawer> Drawer panel... </div>
  <div main>
    <iron-swipeable-pages>...</iron-swipeable-pages>
  </div>
</paper-drawer-panel>

When I use this layout and swipe from edge of mobile screen, the drawer will open by swipe normally, but problem is <iron-swipeable-pages> will also change page by the edge swipe action.

Is there have any way to prevent trigger the default Track event in Edge swipe? (some thing like disableSwipe state or stopPropagation)

MeTaNoV commented 8 years ago

Hi @JohnsonChung , this is indeed a case with a potntial tracking conflict. Disabling swipe will not help so much, but I will also add this option. What could be better is to define a minimum and maximum range value on the horizontal scale so that it does not interfere with the drwaer part! I'll keep you informed when ready! Or if you want to start a PR, feel free! Cheers, Pascal

dominikIncibit commented 8 years ago

I would suggest you to switch over to the newer app-layout elements. They work better in every aspect and this issue doesn't occur there.

MeTaNoV commented 8 years ago

well, adding more option to the element is also good! :) I am wondering why it does not interfere with the new app-layout though... I need to take a look later!

JohnsonChung commented 8 years ago

@fleckdalm, thanks I know the <app-layout> in the PolymerLabs and try it before. It not actually fit my needs, but I didn't know that <iron-swipeable-pages> work fine inside layout. It really interesting for heard that <3, so I take a look again. The key is to use pseudo element(::after) build a swipe area hover main content. ( red line part ) asd

But, there still some question, when I try to repeat the trick in my elements, the <app-layout> allow you scroll main content vertically event in the ::after area, but I can't do that. There still some interesting things inside.

MeTaNoV commented 8 years ago

gonna merge the enhancement with edge sensitivity, tell me if you need anything else!