Skip to content
This repository was archived by the owner on Feb 25, 2020. It is now read-only.

Commit bd269ef

Browse files
committed
fix: don't keep unfocused header backgrounds visible
1 parent aca4c1d commit bd269ef

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

src/TransitionConfigs/HeaderStyleInterpolators.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,12 @@ export function forFade({
106106
leftButtonStyle: { opacity },
107107
rightButtonStyle: { opacity },
108108
titleStyle: { opacity },
109-
backgroundStyle: { opacity: current.progress },
109+
backgroundStyle: {
110+
opacity: interpolate(progress, {
111+
inputRange: [0, 1, 1.9, 2],
112+
outputRange: [0, 1, 1, 0],
113+
}),
114+
},
110115
};
111116
}
112117

src/navigators/__tests__/__snapshots__/NestedNavigator.test.tsx.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ Array [
383383
"top": 0,
384384
},
385385
Object {
386-
"opacity": NOOP {},
386+
"opacity": undefined,
387387
},
388388
]
389389
}
@@ -523,7 +523,7 @@ Array [
523523
"top": 0,
524524
},
525525
Object {
526-
"opacity": NOOP {},
526+
"opacity": undefined,
527527
},
528528
]
529529
}

src/navigators/__tests__/__snapshots__/StackNavigator.test.tsx.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ Array [
215215
"top": 0,
216216
},
217217
Object {
218-
"opacity": NOOP {},
218+
"opacity": undefined,
219219
},
220220
]
221221
}
@@ -554,7 +554,7 @@ Array [
554554
"top": 0,
555555
},
556556
Object {
557-
"opacity": NOOP {},
557+
"opacity": undefined,
558558
},
559559
]
560560
}

0 commit comments

Comments
 (0)