-
-
Notifications
You must be signed in to change notification settings - Fork 917
Description
Version
v5
Reanimated Version
v3
Gesture Handler Version
v2
Platforms
iOS
What happened?
Switching from text input to a numeric input (not the other way around) is cause the modal to close. I could not test in Android but happens in iOS.
Reproduction steps
Could not make BottomSheetModal show in expo snack, this bug happens in my development build.
How to reproduce the bug:
- Run this in Expo or bare React Native with @gorhom/bottom-sheet v4.4.5.
- Open the sheet, focus the text input, then switch to the numeric input.
Example modal that causes the unwanted close:
<BottomSheetModal
ref={sheetRef}
index={0}
snapPoints={snapPoints}
onDismiss={() => console.log("Sheet dismissed")}
keyboardBehavior="interactive"
keyboardBlurBehavior="restore"
enablePanDownToClose={false}
>
{/* Use BottomSheetScrollView or BottomSheetView */}
<BottomSheetScrollView contentContainerStyle={{ padding: 20 }}>
<Text style={{ marginBottom: 10 }}>Text Input:
<BottomSheetTextInput
style={{
borderWidth: 1,
borderColor: "#ccc",
padding: 10,
marginBottom: 20,
borderRadius: 5,
}}
placeholder="Text input"
value={textValue}
onChangeText={setTextValue}
/>
<Text style={{ marginBottom: 10 }}>Numeric Input:</Text>
<BottomSheetTextInput
style={{
borderWidth: 1,
borderColor: "#ccc",
padding: 10,
borderRadius: 5,
}}
placeholder="Numeric input"
value={numberValue}
onChangeText={setNumberValue}
keyboardType="numeric"
/>
</BottomSheetScrollView>
</BottomSheetModal>
Reproduction sample
https://snack.expo.dev/@cereja/mixed-inputs-bug-bottomsheet