Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable swipe for NavigationCard? #49

Open
aksonov opened this issue Mar 14, 2016 · 8 comments
Open

Disable swipe for NavigationCard? #49

aksonov opened this issue Mar 14, 2016 · 8 comments

Comments

@aksonov
Copy link

aksonov commented Mar 14, 2016

Could i disable swipe for NavigationCard?

@ericvicenti
Copy link
Owner

@hedgerwang has an upcoming way to do this. Hedger, can we be sure to add it to the docs?

@hedgerwang
Copy link
Collaborator

@ericvicenti : I'll do that once my latest diff lands.

@5amfung
Copy link

5amfung commented Mar 24, 2016

Any update?

@hedgerwang
Copy link
Collaborator

@5amfung

You can disable the gesture by doing this.

<NavigationCard panHandlers={null} />

@jarredwitt
Copy link

Any chance we could get panHandlers={null} to transfer to the NavigationCard when using a NavigationCardStack?

@ericvicenti
Copy link
Owner

@jarredwitt That sounds reasonable. Feel free to send a PR and tag me and/or Hedger

@jarredwitt
Copy link

@ericvicenti Will do. I also noticed that NavigationCard doesn't take the direction prop anymore. Was that intentional?

@hedgerwang
Copy link
Collaborator

@jarredwitt:

NavigationCardStack is primarily a simple component with canned "built-in" animation and gestures.
The prop direction direction says that you can decide how the transition and gesture should be handled with just one property.

However, once you start to let people "customize" this component, the prop "direction" may not make sense at all cause it not not necessarily match to what the animation style and gesture pan-handlers are doing.

To be honest, I'm seriously considering removing NavigationCardStack and NavigationCard from the source code otherwise we'd end up with a component with countless of "customization" props that can't be defined stickily without contradicts to one or another.

We've made such mistake with Navigator by allowing people adding random APIs to it instead of provide proper building blocks.

My advice of the replacement of NavigationCardStack will be just like this:

      <NavigationAnimatedView
        navigationState={navigationState}
        renderOverlay={renderOverlay}
        renderScene={renderScene}
      />

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants