Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v4] How to decrease the duration of the Bottom Sheet Modal animation? #1769

Closed
Acetyld opened this issue Mar 13, 2024 · 1 comment
Closed
Labels
bug Something isn't working

Comments

@Acetyld
Copy link

Acetyld commented Mar 13, 2024

Bug / Feature?

Right now the modal takes a bit to show, this is normally fine, but we use it as a dropdown for inputs, and if it is a 100% modal it takes just to long to show and hide.

Hide is biggest problem, because this will cause the items below to not be clickable before the backdrop is hidden

Environment info

Library Version
@gorhom/bottom-sheet 4.6.1
react-native 0.73.4
react-native-reanimated 3.6.2
react-native-gesture-handler 2.14.0

Steps To Reproduce

  1. Create a bottom-sheet modal + a backdrop without touch through
  2. Show modal 100% snappoint
  3. See the duration

Describe what you expected to happen:

  1. Ability/prop to change duration

Reproducible sample code

Any bottom sheet modal

@Acetyld Acetyld added the bug Something isn't working label Mar 13, 2024
@Acetyld
Copy link
Author

Acetyld commented Mar 13, 2024

Found it =) Animations configs,

Default is:

const ANIMATION_EASING: Animated.EasingFunction = Easing.out(Easing.exp);
const ANIMATION_DURATION = 250;

const ANIMATION_CONFIGS_IOS = {
  damping: 500,
  stiffness: 1000,
  mass: 3,
  overshootClamping: true,
  restDisplacementThreshold: 10,
  restSpeedThreshold: 10,
};

const ANIMATION_CONFIGS_ANDROID = {
  duration: ANIMATION_DURATION,
  easing: ANIMATION_EASING,
};

const ANIMATION_CONFIGS =
  Platform.OS === 'ios' ? ANIMATION_CONFIGS_IOS : ANIMATION_CONFIGS_ANDROID;

@Acetyld Acetyld closed this as completed Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant