Skip to content

Commit d03eb78

Browse files
regression: modal touchables not working after RNGH migration (#7101)
Co-authored-by: Otávio Stasiak <91474186+OtavioStasiak@users.noreply.github.com>
1 parent 91b2234 commit d03eb78

File tree

5 files changed

+38
-20
lines changed

5 files changed

+38
-20
lines changed

app/containers/TwoFactor/index.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import useDeepCompareEffect from 'use-deep-compare-effect';
77
import { useForm } from 'react-hook-form';
88
import * as yup from 'yup';
99
import { yupResolver } from '@hookform/resolvers/yup';
10+
import { GestureHandlerRootView } from 'react-native-gesture-handler';
1011

1112
import { ControlledFormTextInput } from '../TextInput';
1213
import I18n from '../../i18n';
@@ -157,7 +158,7 @@ const TwoFactor = React.memo(() => {
157158
useNativeDriver
158159
isVisible={visible}
159160
hideModalContentWhileAnimating>
160-
<View style={styles.container} testID='two-factor'>
161+
<GestureHandlerRootView style={styles.container} testID='two-factor'>
161162
<View
162163
style={[
163164
styles.content,
@@ -198,7 +199,7 @@ const TwoFactor = React.memo(() => {
198199
</View>
199200
</View>
200201
<Toast />
201-
</View>
202+
</GestureHandlerRootView>
202203
</Modal>
203204
);
204205
});

app/views/ChangePasscodeView.tsx

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { StyleSheet } from 'react-native';
33
import useDeepCompareEffect from 'use-deep-compare-effect';
44
import isEmpty from 'lodash/isEmpty';
55
import Modal from 'react-native-modal';
6+
import { GestureHandlerRootView } from 'react-native-gesture-handler';
67

78
import { hasNotch } from '../lib/methods/helpers';
89
import { PasscodeChoose } from '../containers/Passcode';
@@ -12,6 +13,11 @@ import { CHANGE_PASSCODE_EMITTER } from '../lib/constants/localAuthentication';
1213
import Touch from '../containers/Touch';
1314

1415
const styles = StyleSheet.create({
16+
container: {
17+
flex: 1,
18+
justifyContent: 'center',
19+
alignItems: 'center'
20+
},
1521
modal: {
1622
margin: 0
1723
},
@@ -69,12 +75,14 @@ const ChangePasscodeView = React.memo(() => {
6975

7076
return (
7177
<Modal useNativeDriver isVisible={visible} hideModalContentWhileAnimating style={styles.modal}>
72-
<PasscodeChoose finishProcess={onSubmit} force={data?.force} />
73-
{!data?.force ? (
74-
<Touch onPress={onCancel} style={styles.close}>
75-
<CustomIcon name='close' size={30} />
76-
</Touch>
77-
) : null}
78+
<GestureHandlerRootView style={styles.container}>
79+
<PasscodeChoose finishProcess={onSubmit} force={data?.force} />
80+
{!data?.force ? (
81+
<Touch onPress={onCancel} style={styles.close}>
82+
<CustomIcon name='close' size={30} />
83+
</Touch>
84+
) : null}
85+
</GestureHandlerRootView>
7886
</Modal>
7987
);
8088
});

app/views/JitsiMeetView/JitsiAuthModal.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { useNavigation } from '@react-navigation/native';
22
import React from 'react';
33
import { Linking, StyleSheet, Text, View } from 'react-native';
44
import Modal from 'react-native-modal';
5+
import { GestureHandlerRootView } from 'react-native-gesture-handler';
56

67
import sharedStyles from '../Styles';
78
import Button from '../../containers/Button';
@@ -48,7 +49,7 @@ const JitsiAuthModal = ({
4849

4950
return (
5051
<Modal isVisible>
51-
<View style={[styles.container, { backgroundColor: colors.surfaceRoom }]}>
52+
<GestureHandlerRootView style={[styles.container, { backgroundColor: colors.surfaceRoom }]}>
5253
<Text style={[styles.title, { color: colors.fontTitlesLabels }]}>{i18n.t('Jitsi_may_require_authentication')}</Text>
5354
{isAdmin ? (
5455
<Text style={[styles.regular, { color: colors.fontTitlesLabels }]}>
@@ -75,7 +76,7 @@ const JitsiAuthModal = ({
7576
}}
7677
/>
7778
</View>
78-
</View>
79+
</GestureHandlerRootView>
7980
</Modal>
8081
);
8182
};

app/views/RoomView/Banner.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, { useState } from 'react';
2-
import { Text, View } from 'react-native';
3-
import { BorderlessButton, ScrollView } from 'react-native-gesture-handler';
2+
import { Text } from 'react-native';
3+
import { BorderlessButton, GestureHandlerRootView, ScrollView } from 'react-native-gesture-handler';
44
import Modal from 'react-native-modal';
55

66
import Markdown, { MarkdownPreview } from '../../containers/markdown';
@@ -42,12 +42,12 @@ const Banner = React.memo(
4242
isVisible={showModal}
4343
animationIn='fadeIn'
4444
animationOut='fadeOut'>
45-
<View style={[styles.modalView, { backgroundColor: themes[theme].surfaceNeutral }]}>
45+
<GestureHandlerRootView style={[styles.modalView, { backgroundColor: themes[theme].surfaceNeutral }]}>
4646
<Text style={[styles.bannerModalTitle, { color: themes[theme].fontSecondaryInfo }]}>{title}</Text>
4747
<ScrollView style={styles.modalScrollView}>
4848
<Markdown msg={text} />
4949
</ScrollView>
50-
</View>
50+
</GestureHandlerRootView>
5151
</Modal>
5252
</>
5353
);

app/views/ScreenLockedView.tsx

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import React, { useEffect, useState } from 'react';
33
import { StyleSheet } from 'react-native';
44
import Modal from 'react-native-modal';
55
import useDeepCompareEffect from 'use-deep-compare-effect';
6+
import { GestureHandlerRootView } from 'react-native-gesture-handler';
67

78
import { PasscodeEnter } from '../containers/Passcode';
89
import { LOCAL_AUTHENTICATE_EMITTER } from '../lib/constants/localAuthentication';
@@ -19,6 +20,11 @@ interface IData {
1920
}
2021

2122
const styles = StyleSheet.create({
23+
container: {
24+
flex: 1,
25+
justifyContent: 'center',
26+
alignItems: 'center'
27+
},
2228
close: {
2329
position: 'absolute',
2430
top: hasNotch ? 50 : 30,
@@ -73,12 +79,14 @@ const ScreenLockedView = (): JSX.Element => {
7379
style={{ margin: 0 }}
7480
animationIn='fadeIn'
7581
animationOut='fadeOut'>
76-
<PasscodeEnter hasBiometry={!!data?.hasBiometry} finishProcess={onSubmit} />
77-
{data?.force ? (
78-
<Touch onPress={onCancel} style={styles.close}>
79-
<CustomIcon name='close' size={30} />
80-
</Touch>
81-
) : null}
82+
<GestureHandlerRootView style={styles.container}>
83+
<PasscodeEnter hasBiometry={!!data?.hasBiometry} finishProcess={onSubmit} />
84+
{data?.force ? (
85+
<Touch onPress={onCancel} style={styles.close}>
86+
<CustomIcon name='close' size={30} />
87+
</Touch>
88+
) : null}
89+
</GestureHandlerRootView>
8290
</Modal>
8391
);
8492
};

0 commit comments

Comments
 (0)