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

[Android]: Modal with slide animation suppresses onPress callbacks #5739

Closed
1 of 5 tasks
cjshearer opened this issue Apr 25, 2023 · 1 comment
Closed
1 of 5 tasks

Comments

@cjshearer
Copy link

cjshearer commented Apr 25, 2023

Description

Actionsheet (or a modal containing a slide transition) suppresses callbacks for children when using the slide animation.

CodeSandbox/Snack link

https://codesandbox.io/s/delicate-sound-6dodwc?file=/src/components/Example.tsx

Steps to reproduce

  1. Create an Actionsheet containing a child with an onPress callback. Let's say it's a button.
  2. With a physical Android device, click on the actionsheet's button (this seems to work just fine on an emulator).

Note how, despite the button visually reacting to the press, the button's callback does not run.

  1. Add animationPreset="none" to the Actionsheet's props
  2. Repeat step 2

Note how the button's callback now runs.

NativeBase Version

3.3.1

Platform

  • Android
  • CRA
  • Expo
  • iOS
  • Next

Other Platform

Pixel 7 - Android 13, LGV30 - Android 10, Pixel 3 - Android 12.

Additional Information

We're using the new architecture.

I believe the origin of this issue comes somewhere from the native-base/src/components/composites/Transitions/Slide.tsx or one of its dependencies, as this only occurs when a Modal has a slide transition (as an Actionsheet does by default on an Android device). Disabling the slide animation resolves the issue. I'll admit it's possible this bug comes from a library used by native base, but this seems like a good start to discover the source of the issue and at the very least it documents a work around.

The below video shows the issue as presented from steps 1 and 2, followed by steps 3 and 4 after the hot-reload that disables the slide animation.

ScreenRecord-2023-04-25-09-50-16.mp4
@cjshearer cjshearer changed the title [Android, Modal]: Modal with slide animation suppresses onPress callbacks [Android]: Modal with slide animation suppresses onPress callbacks Apr 25, 2023
@cjshearer
Copy link
Author

See the above mentioned issue. I don't think this is a NativeBase issue, but a react-native fabric issue. Closing until I find out one way or the other.

@cjshearer cjshearer closed this as not planned Won't fix, can't repro, duplicate, stale May 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant