Skip to content

Conversation

pakerwreah
Copy link
Contributor

@pakerwreah pakerwreah commented Jun 13, 2025

Fix #2452

@pakerwreah pakerwreah changed the title Fix animatedIndex -1 when resizing TextInput fix: animatedIndex -1 when resizing TextInput Jun 13, 2025
Copy link

This PR is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 10 days.

@pakerwreah
Copy link
Contributor Author

not stale

@gorhom gorhom force-pushed the master branch 2 times, most recently from 425b6ec to a123b17 Compare August 17, 2025 21:39
@gorhom gorhom self-assigned this Aug 18, 2025
@gorhom gorhom added the v5 label Aug 18, 2025
@gorhom
Copy link
Owner

gorhom commented Aug 18, 2025

hi @pakerwreah , thanks for submitting this PR, i have tested the usecase in my side, and i did not managed to repo

Simulator.Screen.Recording.-.iPhone.16.Pro.Max.-.2025-08-18.at.19.38.32.mp4

I have done recently a major refactor to layouting as part of v5.2. could you test the latest version and let me know if it still occurring

@pakerwreah
Copy link
Contributor Author

pakerwreah commented Aug 18, 2025

Hey @gorhom 👋🏻
You need the software keyboard enabled to reproduce it.

It also happens with v5.2.3, but it's even worse.
The 2nd time you hit backspace the bottom sheet completely closes 🙈

Here's a demo project running in Expo Go in the simulator.
💡 branch: bottom-sheet-bug-repro
https://github.com/pakerwreah/react-native-shared-header/tree/bottom-sheet-bug-repro

v5.1.8 (without then with keyboard) v5.2.3
Screen.Recording.2025-08-18.at.19.59.02.mov
v5.2.1.mov

@pakerwreah
Copy link
Contributor Author

pakerwreah commented Sep 3, 2025

It still happens in v5.2.4, but got even worse than v5.2.3.
The bottom sheet disappears just by hitting return/enter, which resizes the input.

I synched this PR with master and fixed it for v5.2.4.

@pakerwreah
Copy link
Contributor Author

btw, if we add ANIMATION_SOURCE.MOUNT to the check, it also fixes this other issue 👇🏻

@pakerwreah pakerwreah changed the title fix: animatedIndex -1 when resizing TextInput fix(#2452): Bottom Sheet with multiline TextInput auto-closes in v5.2.5 Sep 4, 2025
@pakerwreah
Copy link
Contributor Author

pakerwreah commented Sep 4, 2025

I created a brand-new issue with the proper reproduction snack #2452
If this solution gets merged, I can open another PR to fix the modal issue as well.
It would be just adding ANIMATION_SOURCE.MOUNT to the same spot.

#2324 (comment)

Copy link
Owner

@gorhom gorhom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for submitting this PR, LGTM

@gorhom gorhom merged commit c68edac into gorhom:master Sep 5, 2025
@pakerwreah pakerwreah deleted the patch-1 branch September 5, 2025 09:11
@abdulbasiAmjeo
Copy link

On opened again getting error now .
Invariant Violation: 'index' was provided but out of the provided snap points range! expected value to be between -1, 2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Bottom Sheet with multiline TextInput auto-closes in v5.2.5
3 participants