Skip to content

Commit 04ffa6c

Browse files
Merge pull request #47992 from margelo/@perunt/hide-mention-list
Fix suggestion overlay
2 parents 1af81ee + 2c70f67 commit 04ffa6c

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/components/AutoCompleteSuggestions/AutoCompleteSuggestionsPortal/TransparentOverlay/TransparentOverlay.tsx

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, {useCallback} from 'react';
1+
import React, {useCallback, useMemo} from 'react';
22
import {View} from 'react-native';
33
import type {PointerEvent} from 'react-native';
44
import type PressableProps from '@components/Pressable/GenericPressable/types';
@@ -29,14 +29,23 @@ function TransparentOverlay({onPress: onPressProp}: TransparentOverlayProps) {
2929
e?.preventDefault();
3030
}, []);
3131

32+
// The overlay is a semi-transparent layer that covers the entire screen and is used to close a modal when clicked.
33+
// The touch event passes through the transparent overlay to the elements underneath, so we need to prevent that by adding a nearly invisible background color to the overlay.
34+
const overlay = useMemo(
35+
() => ({
36+
backgroundColor: 'rgba(0, 0, 0, 0.005)',
37+
}),
38+
[],
39+
);
40+
3241
return (
3342
<View
3443
onPointerDown={handlePointerDown}
3544
style={styles.fullScreen}
3645
>
3746
<PressableWithoutFeedback
3847
onPress={onPress}
39-
style={[styles.flex1, styles.cursorDefault]}
48+
style={[styles.flex1, styles.cursorDefault, overlay]}
4049
accessibilityLabel={translate('common.close')}
4150
role={CONST.ROLE.BUTTON}
4251
/>

0 commit comments

Comments
 (0)