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

Unable to dismiss bottom drawer when predictive back gesture is on #602

Open
lazzzis opened this issue Jan 29, 2024 · 3 comments
Open

Unable to dismiss bottom drawer when predictive back gesture is on #602

lazzzis opened this issue Jan 29, 2024 · 3 comments

Comments

@lazzzis
Copy link

lazzzis commented Jan 29, 2024

Environment Information

  • Package version(s): 0.1.46
  • Android SDK version: Android T or above is required

Please provide a reproduction of the bug:

I am working on refactoring my app to support Android's predictive back gesture, which is expected to be enabled by default from Android 15.

To test it on Android 13 and 14, following these instructions:

  1. Enable Develop options -> Predictive back animations
  2. add android:enableOnBackInvokedCallback="true" in AndroidManifest.xml
  3. Launch FluentUi.Demo -> V2 Components -> V2 Bottom Drawer -> Open Drawer
  4. swipe back or press back button

Actual behavior:

Unable to dismiss the bottom drawer.

Expected behavior:

Swiping back should dismiss the bottom drawer.

Priorities and help requested:

Are you willing to submit a PR to fix?

Okay but need guidance. I know the reason why it fails is because currently ModalPopup relies on KEYCODE_BACK to handle back events.

But per android's doc, once predictive back gesture is enabled, Android OS will not send KEYCODE_BACK when back button is pressed. The solution is to migrated to OnBackPressedDispatcher as suggested by Android's official guide. But due to potential complexities, I am not very confident to refactor ModalPopup without guidance.

Screenshot 2024-01-28 at 11 44 06 PM

Requested priority: High

@Dhruv-Mishra
Copy link
Contributor

Hey @lazzzis I don't see the option to enable predictive back animations within the developer options on both my android 14 and android 15 emulated pixel devices, can you share which device you are using?

@lazzzis
Copy link
Author

lazzzis commented Oct 14, 2024

Android 14, Pixel 5a. Image

Copy link
Contributor

@Dhruv-Mishra

Gentle ping that this issue needs attention.

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

3 participants