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

Change allowedDirections Dynamically #41

Open
jeromestsauver opened this issue Nov 9, 2017 · 1 comment
Open

Change allowedDirections Dynamically #41

jeromestsauver opened this issue Nov 9, 2017 · 1 comment

Comments

@jeromestsauver
Copy link

Great library - I have been trying to only allow certain 'types' of cards to be swiped in one direction and other 'types' in the opposite direction.

Is it possible to update the configuration of the stackConfig based on the "type" of card on the top of the stack?

Currently I'm able to detect the type of card, and then set the stackConfig.allowedDirections array to what I would like it to be. However it doesn't seem to effect behavior of the stack.

Is there a refresh that is needed?

Any direction you could provide would be very much appreciated.

@mashhoodr
Copy link
Collaborator

Hello @becomplete

As far as I know, you cant do this with the library at the moment. For this you will need to configure additional hooks which will either allow or disable the drag depending on the direction and item selected. Allowed driections is used on initialized, changing it after will probably not have any effect.

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

2 participants