Skip to content

[Bug]: wrong index reported by modal + TextInput + autofocus (v5.2.6) #2455

@pakerwreah

Description

@pakerwreah

Version

v5

Reanimated Version

v3

Gesture Handler Version

v2

Platforms

iOS

What happened?

[v5.2.6] BottomSheetModal onChange is reporting corrupted index on mount when we have TextInput + autofocus.

That also breaks keyboardBlurBehavior="restore"

This issue might be related to this comment about invariant throwing errors for unexpected index.

Reproduction steps

  • Just open the modal and see the console reporting a big number for index
  • Verify that keyboardBlurBehavior="restore" doesn't work when you tap "return" to dismiss the keyboard

Reproduction sample

https://snack.expo.dev/@pakerwreah/bottom-sheet-modal---wrong-index

Relevant log output

iPhone: handleSheetChanges 774 // on open
iPhone: handleSheetChanges 0   // on collapse
iPhone: handleSheetChanges -1  // on close

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingv5

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions