NativeBase icon indicating copy to clipboard operation
NativeBase copied to clipboard

Action sheet animation slides up instead of fading in

Open NoahDavey opened this issue 3 years ago • 18 comments

Description

The backdrop for Actionsheet slides up instead of fading in. Ideally I would like this transition to be configurable if nothing else, the slide feels quite weird atm

CodeSandbox/Snack link

N/A

Steps to reproduce

For Slide animation

  1. Use Native base v3.4.X
  2. Add actionsheet to a RN app
  3. Actionsheet backdrop slides up weirdly

slide-animation

For fade animation

  1. I am currently using v3.3.0 Which has the face animation
  2. Add actionsheet
  3. Actionsheet backdrop fades in

fade-animation

NativeBase Version

3.4.X

Platform

  • [X] Android
  • [ ] CRA
  • [ ] Expo
  • [ ] iOS
  • [ ] Next

Other Platform

No response

Additional Information

I did find this issue but ideally would prefer if this transition is configurable rather than just always doing a slide. Makes me not want to upgrade my version as it looks a bit jank with what I want to use it for. Any help here would be amazing 🙏

NoahDavey avatar Dec 04 '22 05:12 NoahDavey

Thanks for reporting @NoahDavey, We will check this.

AshwiniKumar007 avatar Dec 08 '22 09:12 AshwiniKumar007

Thanks for looking into it @AshwiniKumar007 lmk if I can give anymore details or help in anyway :D

NoahDavey avatar Dec 08 '22 09:12 NoahDavey

We are also experiencing this on Android. It works fine on iOS.

Catdaemon avatar Dec 12 '22 16:12 Catdaemon

Same here.

https://github.com/GeekyAnts/NativeBase/blob/099c77e780d4814727048378389e3a74390aeb37/src/components/composites/Actionsheet/Actionsheet.tsx#L28-L40

And, seems props._backdrop did not pass to _overlay.

heemoe avatar Dec 16 '22 10:12 heemoe

Hey @AshwiniKumar007 Wondering if you had any luck with looking into this one :)

NoahDavey avatar Jan 08 '23 01:01 NoahDavey

Currently experiencing this issue too, Works fine on IOS, just not android.

robjakedorsett avatar Feb 07 '23 13:02 robjakedorsett

same issue

JorSargsyan avatar Feb 21 '23 12:02 JorSargsyan

Same issue here. Android. Also, when actionsheet is open, the statusbar changes to dark-content, which i believe it should not.

veigamann avatar Feb 26 '23 23:02 veigamann

It can be fixed temporarily by passing animationPreset="fade" to ActionSheet as a prop. But note that doing this will make the Action sheet fade in & out instead of sliding. So, it can be a temporary solution until the bug is fixed.

rajatkantinandi avatar Mar 09 '23 06:03 rajatkantinandi

Try it here: https://snack.expo.dev/@rajatkn/bc87b1

rajatkantinandi avatar Mar 09 '23 06:03 rajatkantinandi

The root of this issue is in the implementation of Modals: https://github.com/GeekyAnts/NativeBase/blob/b9a36dc9fec2f9f5aff30046d2f304e97673d71a/src/components/composites/Modal/Modal.tsx#L81-L90

Since the overlay of modals uses the same animationPreset as the content it's not possible to control only the content animation for Modals/ActionsSheets/Selects etc. If you want to fix it for now and don't use any modals where backdrops are supposed to slide in you can just set animationPreset='fade' on the Overlay

Hubi1234 avatar Mar 15 '23 14:03 Hubi1234

Hey team thanks for the suggestions around animationPreset='fade' I think we won't do this for now as it looks kinda jank with the actionsheet. At least more jank than the slide up backdrop does haha 😅

It is interesting though that the animation works correctly on iOS? Maybe just some underlying native animation that is different or something?

NoahDavey avatar Mar 15 '23 23:03 NoahDavey

Hey @AshwiniKumar007 just bumping this issue :)

NoahDavey avatar May 04 '23 01:05 NoahDavey

+1

JosephLu2022 avatar May 04 '23 18:05 JosephLu2022

Are there any viable workarounds yet?

robjakedorsett avatar May 05 '23 16:05 robjakedorsett

Are there any viable workarounds yet?

Did you try this approach? https://github.com/GeekyAnts/NativeBase/issues/5583#issuecomment-1470139631

it works for me on android and is only one line of code changed in the source files of the native base modals

Hubi1234 avatar May 08 '23 14:05 Hubi1234

Isn't there a possibility to pass down the _backdrop props to _overlay, or set a separate animationPreset on the ActionSheet?

Parjoona avatar Jun 14 '23 12:06 Parjoona

https://github.com/GeekyAnts/NativeBase/blob/b9a36dc9fec2f9f5aff30046d2f304e97673d71a/src/components/composites/Modal/Modal.tsx#L92-L101 My workaround is just move the <Backdrop> inside another <Overlay> with animationPreset="fade" and remove the <Fade> component like the code below. This will keep the slide animation for the sheet and fade for the backdrop instead of fade for both when updating animation preset of the Modal in Actionsheet.tsx or in the https://github.com/GeekyAnts/NativeBase/issues/5583#issuecomment-1470139631. Note that i only change this for android, this change will behave different in ios.

The changes: image

nhhai1605 avatar Aug 03 '23 10:08 nhhai1605