Fix transition between 2 screens with no header (#3939)

This commit is contained in:
Janic Duplessis
2018-04-09 15:32:27 -04:00
committed by Eric Vicenti
parent 5274d16e3b
commit 70c644f522

View File

@@ -58,8 +58,19 @@ function forLayout(props) {
const { first, last } = interpolate;
const index = scene.index;
const width = layout.initWidth;
// Make sure the header stays hidden when transitioning between 2 screens
// with no header.
if (
(isBack && !hasHeader(scenes[index]) && !hasHeader(scenes[last])) ||
(!isBack && !hasHeader(scenes[first]) && !hasHeader(scenes[index]))
) {
return {
transform: [{ translateX: width }],
};
}
const rtlMult = I18nManager.isRTL ? -1 : 1;
const translateX = position.interpolate({
inputRange: [first, index, last],