This repository has been archived by the owner on Jun 24, 2022. It is now read-only.
Fixes blank tutorial pages when in landscape #823
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What this does
This fixes an issue where tutorial pages would render as blank when presented in landscape mode.
Why? How?
The
Carousel
's rendering optimization (of not rendering off-screen elements) was not rendering the first element when the Carousel itself was completely offscreen. A re-render was properly triggering it to be visible, but the effect is a little jarring (it's a screen flicker) or broken (completely blank in landscape mode as no re-render is triggered.)By disabling
removeClippedSubviews
this forces the views to be rendered and visible. A side-effect of this is that the views that are off-screen are rendered and on the stack, but given the small quantity of views, this may be an acceptable change.An alternative fix would be to use
Carousel
'striggerRenderingHack
-- see: https://github.com/archriss/react-native-snap-carousel/blob/master/doc/PROPS_METHODS_AND_GETTERS.md#methods -- which addresses this issue specifically.Note: This issue was not evident when the device was in portrait mode as a weird "jiggle" is present when opening the view in portrait mode. That jiggle seems to be a rendering bug. This appears to force the view to re-render (correctly.) Gif with slow animations below:
Without fix
With fix
Tested