Skip to content

Commit 9b67a88

Browse files
committed
fix: don't disable interactions on the scene
1 parent d53582e commit 9b67a88

File tree

2 files changed

+14
-21
lines changed

2 files changed

+14
-21
lines changed

src/components/BottomNavigation.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -648,10 +648,7 @@ class BottomNavigation extends React.Component<Props, State> {
648648
const rippleSize = layout.width / 4;
649649

650650
return (
651-
<View
652-
style={[styles.container, style]}
653-
pointerEvents={layout.measured ? 'auto' : 'none'}
654-
>
651+
<View style={[styles.container, style]}>
655652
<View style={[styles.content, { backgroundColor: colors.background }]}>
656653
{routes.map((route, index) => {
657654
if (!loaded.includes(index)) {
@@ -717,7 +714,11 @@ class BottomNavigation extends React.Component<Props, State> {
717714
] as StyleProp<ViewStyle>
718715
}
719716
pointerEvents={
720-
keyboardHidesNavigationBar && keyboard ? 'none' : 'auto'
717+
layout.measured
718+
? keyboardHidesNavigationBar && keyboard
719+
? 'none'
720+
: 'auto'
721+
: 'none'
721722
}
722723
onLayout={this.handleLayout}
723724
>

src/components/__tests__/__snapshots__/BottomNavigation.test.js.snap

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
exports[`hides labels in non-shifting bottom navigation 1`] = `
44
<View
5-
pointerEvents="none"
65
style={
76
Array [
87
Object {
@@ -56,7 +55,7 @@ exports[`hides labels in non-shifting bottom navigation 1`] = `
5655
</View>
5756
<View
5857
onLayout={[Function]}
59-
pointerEvents="auto"
58+
pointerEvents="none"
6059
style={
6160
Object {
6261
"backgroundColor": "#ffffff",
@@ -675,7 +674,6 @@ exports[`hides labels in non-shifting bottom navigation 1`] = `
675674

676675
exports[`hides labels in shifting bottom navigation 1`] = `
677676
<View
678-
pointerEvents="none"
679677
style={
680678
Array [
681679
Object {
@@ -729,7 +727,7 @@ exports[`hides labels in shifting bottom navigation 1`] = `
729727
</View>
730728
<View
731729
onLayout={[Function]}
732-
pointerEvents="auto"
730+
pointerEvents="none"
733731
style={
734732
Object {
735733
"backgroundColor": "#ffffff",
@@ -1368,7 +1366,6 @@ exports[`hides labels in shifting bottom navigation 1`] = `
13681366

13691367
exports[`renders custom icon and label in non-shifting bottom navigation 1`] = `
13701368
<View
1371-
pointerEvents="none"
13721369
style={
13731370
Array [
13741371
Object {
@@ -1422,7 +1419,7 @@ exports[`renders custom icon and label in non-shifting bottom navigation 1`] = `
14221419
</View>
14231420
<View
14241421
onLayout={[Function]}
1425-
pointerEvents="auto"
1422+
pointerEvents="none"
14261423
style={
14271424
Object {
14281425
"backgroundColor": "#ffffff",
@@ -1981,7 +1978,6 @@ exports[`renders custom icon and label in non-shifting bottom navigation 1`] = `
19811978

19821979
exports[`renders custom icon and label in shifting bottom navigation 1`] = `
19831980
<View
1984-
pointerEvents="none"
19851981
style={
19861982
Array [
19871983
Object {
@@ -2035,7 +2031,7 @@ exports[`renders custom icon and label in shifting bottom navigation 1`] = `
20352031
</View>
20362032
<View
20372033
onLayout={[Function]}
2038-
pointerEvents="auto"
2034+
pointerEvents="none"
20392035
style={
20402036
Object {
20412037
"backgroundColor": "#ffffff",
@@ -2866,7 +2862,6 @@ exports[`renders custom icon and label in shifting bottom navigation 1`] = `
28662862

28672863
exports[`renders custom icon and label with custom colors in non-shifting bottom navigation 1`] = `
28682864
<View
2869-
pointerEvents="none"
28702865
style={
28712866
Array [
28722867
Object {
@@ -2920,7 +2915,7 @@ exports[`renders custom icon and label with custom colors in non-shifting bottom
29202915
</View>
29212916
<View
29222917
onLayout={[Function]}
2923-
pointerEvents="auto"
2918+
pointerEvents="none"
29242919
style={
29252920
Object {
29262921
"backgroundColor": "#E96A82",
@@ -3779,7 +3774,6 @@ exports[`renders custom icon and label with custom colors in non-shifting bottom
37793774

37803775
exports[`renders custom icon and label with custom colors in shifting bottom navigation 1`] = `
37813776
<View
3782-
pointerEvents="none"
37833777
style={
37843778
Array [
37853779
Object {
@@ -3833,7 +3827,7 @@ exports[`renders custom icon and label with custom colors in shifting bottom nav
38333827
</View>
38343828
<View
38353829
onLayout={[Function]}
3836-
pointerEvents="auto"
3830+
pointerEvents="none"
38373831
style={
38383832
Object {
38393833
"backgroundColor": "#E96A82",
@@ -4601,7 +4595,6 @@ exports[`renders custom icon and label with custom colors in shifting bottom nav
46014595

46024596
exports[`renders non-shifting bottom navigation 1`] = `
46034597
<View
4604-
pointerEvents="none"
46054598
style={
46064599
Array [
46074600
Object {
@@ -4655,7 +4648,7 @@ exports[`renders non-shifting bottom navigation 1`] = `
46554648
</View>
46564649
<View
46574650
onLayout={[Function]}
4658-
pointerEvents="auto"
4651+
pointerEvents="none"
46594652
style={
46604653
Object {
46614654
"backgroundColor": "#ffffff",
@@ -5514,7 +5507,6 @@ exports[`renders non-shifting bottom navigation 1`] = `
55145507

55155508
exports[`renders shifting bottom navigation 1`] = `
55165509
<View
5517-
pointerEvents="none"
55185510
style={
55195511
Array [
55205512
Object {
@@ -5568,7 +5560,7 @@ exports[`renders shifting bottom navigation 1`] = `
55685560
</View>
55695561
<View
55705562
onLayout={[Function]}
5571-
pointerEvents="auto"
5563+
pointerEvents="none"
55725564
style={
55735565
Object {
55745566
"backgroundColor": "#ffffff",

0 commit comments

Comments
 (0)