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

Prevent onRightButtonPress From Being Clicked Repeatedly #36

Open
cancan101 opened this issue Nov 18, 2015 · 2 comments
Open

Prevent onRightButtonPress From Being Clicked Repeatedly #36

cancan101 opened this issue Nov 18, 2015 · 2 comments

Comments

@cancan101
Copy link
Contributor

Add some mechanism to prevent onRightButtonPress from being clicked Repeatedly. Right now if the action of clicking onRightButtonPressis asynchronous, it may be hit a second time. Resulting in duplicate navigations.

I tried adding state the button allowing only one press but I don't know how to clear this when the back button is pressed returning to the current route.

Ideally after a call to something like navigator.push(route), the button would be disabled.

@aksonov
Copy link

aksonov commented Dec 9, 2015

I had this problem as well. I've used onWillFocus, onDidBlur handler to prevent duplicate transition - once latest route from navigator.getCurrentRoutes() is not in focus, i'm not processing 'push' action. I've implemented it with new release of https://github.com/aksonov/react-native-router-flux

@corbt
Copy link
Contributor

corbt commented Jan 26, 2016

I created a PR that fixes this issue, but @ide thinks there's a better way to implement it. #71

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

3 participants