Comments (12)
Experiencing this again with [email protected]
Perhaps an issue in react-navigation
. See this thread
from fluidtransitions.
@dtuan I've had a look at your example but are having some troubles finding where in the code these events are generated. Will continue to investigate!
from fluidtransitions.
Hi @dtuan! Thanks for contributing back with your findings. Would you please be so kind to create a simple reproduction of the issue with a short snack? (https://snack.expo.io).
from fluidtransitions.
Hi @chrfalch ,
Here is the simple setup: https://snack.expo.io/BJ8tzC42M
In the example snack I see didFocus and willFocus get called, but blur events not call and isFocused is not correct. So I changed issue's title too.
I think it happens with FluidNavigator nested in DrawerNavigator.
Thanks
from fluidtransitions.
@chrfalch thank you, really appreciate your work,
from fluidtransitions.
I'm still having this issue with the latest version (0.2.3) along with the latest version of react-navigation (2.11.2). That is, willFocus and willBlur events stop firing when navigating back and forth between screens.
I created a new snack with a reproduction of the issue: https://snack.expo.io/rkVKU4O8Q
When navigationg between Master and Detail Screens there should be a log when the different events are triggered. It seems like the correct events are fired when going from Master to Detail. But when going back to Master the didFocus event of the Master Screen is never fired. I guess this could the reason subsequent events are not triggered correctly?
When switching to the built in Stack Navigator ( By uncommenting line 67 and commentiung out line 68 in the snack) the didFocus event is triggered when going back rom Detail to Master and subsequent events seems to fire correctly.
Let me know if the snack is unclear in any way and thanks for a great library!
from fluidtransitions.
Ok ;-) Sorry for closing it down. The problem is that I'm unable to find out where these events are created and what to do with them... Would love some help on this one, @reekris?
from fluidtransitions.
I had a look around the code and I'm not entirely sure how the event system works either tbh :)
But I compared the code between createFluidNavigator.js and the built in StackView.js and noticed a difference in how the onTransitionEnd callbacks are set up. Specifically there is a check wether to perform completeTransition
or not.
Here is how it looks in StackView.js:
In createFluidNavigator.js there is an added check for !lastTransition.navigation.state.isTransitioning
FluidTransitions/src/createFluidNavigator.js
Lines 45 to 48 in 2160a0a
I tried removing that extra check and it seems to have fixed the issue. Now the didFocus and didBlur events are fired and subsequent events seems to work.
Although I might have broken something else :) I guess there is a reason why that check is there?
from fluidtransitions.
I poked around the react-navigation commit history and found this pull request that removes the second check from the built in Stack navigator:
react-navigation/react-navigation#4115
Maybe it should be removed in this library as well?
from fluidtransitions.
Is there any way I can help to move this issue forward? I'd be happy to provide a pull request with the above change, if you think it is the correct solution.
from fluidtransitions.
Should be fixed in PR #83, release 0.2.5 - anyone wants to test and verify?
from fluidtransitions.
@elzii for me this worked
constructor(props) { super(props); this.listener = this.props.navigation.addListener('didBlur', () => ( // do stuff )); }
but the <NavigationEvents />
didn't
from fluidtransitions.
Related Issues (20)
- Update TransitionItemsView componentWillRecieveProps to use getDerivedStateFromProps
- Add support for React Navigation 4 HOT 18
- getting an exception error of unmount Transition shared key
- [question] Transition element on navigate HOT 1
- Does it support React-Native-Navigation
- Unable to modify duration/speed using <Transition> HOT 1
- Transition component's disappear prop does not work
- No header when using fluidNavigator HOT 5
- (0, _reactNavigationFluidTransitions.default) is not a function HOT 3
- React Navigation v4^ the navigation prop is missing for this navigator HOT 1
- get current transition route name
- [ShareElement] How can i zoom out the view container on List Image on share transition?
- Fluid Navigator Transition not working in iOS? HOT 1
- Can't get it to working. HOT 7
- Shared Element Transition - Works Only For One Way
- support react-navigation5 HOT 11
- How to solve the inaccurate moving distance caused by zooming while moving?
- Tab navigation
- typescript
- error message
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fluidtransitions.