Description
Bug
When building out a sheet with a Text Input, the sheet will always expand to the highest snap point when the Text Input is focused.
Environment info
Library | Version |
---|---|
@gorhom/bottom-sheet | ^4 |
react-native | 0.72.6 |
react-native-reanimated | ~3.3.0 |
react-native-gesture-handler | ~2.12.0 |
Steps To Reproduce
For example, I might have a sheet with the following snap points:
[100, 'CONTENT_HEIGHT']
When I focus the Text Input, the Bottom Sheet expands to the CONTENT_HEIGHT
.
screen-20231130-120825.2.mp4
I want to be able to offer the user a chance to further expand the text input, so I update the snap points:
[100, 'CONTENT_HEIGHT', '90%']
Now, though, when I focus the Text Input, the Bottom Sheet will always expand to the 90%
.
screen-20231130-120633.2.mp4
Describe what you expected to happen:
I'm expecting to be able to have the Text Input focus to the minimum required height for the size of my content unless the user specifies otherwise. The effect that I'm trying to achieve is similar to Slack's interface for text input. Some screenshots and examples are provided below.
screen-20231130-122651.2.mp4
What we're trying to achieve (this is a Figma prototype)
Reproducible sample code
I put together this repo that includes an Expo app that you can see the code examples from the recordings above. Running the app is as simple as yarn && yarn start
and works with Expo Go.