Skip to content

Jumpy behaviour when setting sheetInitialDetentIndex to other then 0.  #2543

@blytung

Description

@blytung

Description

When im using sheetInitialDetentIndex and set it to another value then 1, the formSheet is behave jumpy, it hard to stick to the anchor.

Here how it is
https://github.com/user-attachments/assets/c79b61cd-22e3-406d-8139-e485fa01f18e

`
<RootStack.Screen
name="Favorites"
component={Favorites}
options={{
presentation: 'formSheet',
headerShown: true,
title: '',
sheetAllowedDetents: [0.2, 0.5, 0.99],
gestureEnabled: true,
sheetInitialDetentIndex: 2,
sheetLargestUndimmedDetentIndex: 'last',
sheetCornerRadius: 24,

          contentStyle: {
            backgroundColor: COLORS.primaryBackground,
          },
          unstable_screenStyle: {
            backgroundColor: COLORS.primaryBackground,
          },
        }}
      />

`

Expected behaviour:

Simulator.Screen.Recording.-.iPhone.16.Pro.-.2024-11-27.at.12.04.21.mp4

`
<RootStack.Screen
name="Favorites"
component={Favorites}
options={{
presentation: 'formSheet',
headerShown: true,
title: '',
sheetAllowedDetents: [0.2, 0.5, 0.99],
gestureEnabled: true,
sheetInitialDetentIndex: 0,
sheetLargestUndimmedDetentIndex: 'last',
sheetCornerRadius: 24,

          contentStyle: {
            backgroundColor: COLORS.primaryBackground,
          },
          unstable_screenStyle: {
            backgroundColor: COLORS.primaryBackground,
          },
        }}
      />

`

Steps to reproduce

  1. set the sheetInitialDetentIndex to a value other then 0.
  2. using formSheet

Snack or a link to a repository

snack

Screens version

4.0.0

React Native version

0.75.0

Platforms

iOS

JavaScript runtime

None

Workflow

Expo bare workflow

Architecture

Fabric (New Architecture)

Build type

Debug mode

Device

Real device

Device model

iPhone 14 Pro

Acknowledgements

Yes

Metadata

Metadata

Assignees

Labels

Platform: iOSThis issue is specific to iOSRepro providedA reproduction with a snack or repo is provided

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions