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

Modal is getting truncated when rendering at bottom on Android 15 #45490

Open
ManiTWIndia opened this issue Jul 17, 2024 · 6 comments
Open

Modal is getting truncated when rendering at bottom on Android 15 #45490

ManiTWIndia opened this issue Jul 17, 2024 · 6 comments
Assignees
Labels
Component: Modal Issue: Author Provided Repro This issue can be reproduced in Snack or an attached project. Type: New Architecture Issues and PRs related to new architecture (Fabric/Turbo Modules)

Comments

@ManiTWIndia
Copy link

ManiTWIndia commented Jul 17, 2024

Description

When we use the React Native Modal and try to render the Modal content at the bottom, upto Android 14 new architecture it is working fine. But in Android 15 new architecture, the Modal rendered at the bottom is not entirely visible and we are only able to see a small section of the Modal rendered.

Please find the video attached below where the issue is happening on Android 15 new architecture

Android_15_With_New_Arch.mov

Please find the video attached below with expected behaviour on Android 14 new architecture

Android_14_With_New_Arch.mov

Note: We have tested this issue on Pixel 7 Pro and Pixel 8 Pro (Emulator)

Steps to reproduce

  1. Run an android simulator with Android 15 version.
  2. After cloning, Run npm install and npx react-native run-android to run the project.

React Native Version

0.74.3

Affected Platforms

Runtime - Android

Areas

Other (please specify)

Output of npx react-native info

System:
  OS: macOS 14.0
  CPU: (10) arm64 Apple M1 Pro
  Memory: 77.34 MB / 16.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 22.4.1
    path: /opt/homebrew/bin/node
  Yarn: Not Found
  npm:
    version: 10.8.1
    path: /opt/homebrew/bin/npm
  Watchman:
    version: 2024.07.08.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods: Not Found
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 23.0
      - iOS 17.0
      - macOS 14.0
      - tvOS 17.0
      - watchOS 10.0
  Android SDK: Not Found
IDEs:
  Android Studio: 2024.1 AI-241.18034.62.2411.12071903
  Xcode:
    version: 15.0/15A240d
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.11
    path: /usr/bin/javac
  Ruby:
    version: 2.6.10
    path: /usr/bin/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.74.3
    wanted: 0.74.3
  react-native-macos: Not Found
npmGlobalPackages:
  "react-native": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: true
iOS:
  hermesEnabled: Not found
  newArchEnabled: false

Stacktrace or Logs

NA

Reproducer

https://github.com/ManiTWIndia/ReactNativeModalIssue

Screenshots and Videos

Android_15_With_New_Arch.mov
@ManiTWIndia ManiTWIndia added Needs: Triage 🔍 Type: New Architecture Issues and PRs related to new architecture (Fabric/Turbo Modules) labels Jul 17, 2024
@github-actions github-actions bot added Needs: Author Feedback Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. Component: Modal and removed Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. labels Jul 17, 2024
@ManiTWIndia ManiTWIndia changed the title Modal rendering behind Nav Gesture Bar when rendering at bottom Modal rendering behind Nav Bar when rendering at bottom Jul 17, 2024
@ManiTWIndia ManiTWIndia changed the title Modal rendering behind Nav Bar when rendering at bottom Modal is getting truncated when rendering at bottom Jul 17, 2024
@cortinico cortinico changed the title Modal is getting truncated when rendering at bottom Modal is getting truncated when rendering at bottom on Android 15 Jul 17, 2024
@cortinico cortinico added Issue: Author Provided Repro This issue can be reproduced in Snack or an attached project. and removed Needs: Triage 🔍 Needs: Author Feedback labels Jul 29, 2024
@Abdelaty-magdy
Copy link

Any updates here?

@cortinico
Copy link
Contributor

Any updates here?

Why are you asking? Are you having the same issue or would you like to take this one to fix it?

@Abdelaty-magdy
Copy link

Any updates here?

Why are you asking? Are you having the same issue or would you like to take this one to fix it?

Yes I'm having the same issue

@alanleedev
Copy link
Contributor

@Abdelaty-magdy @ManiTWIndia I'll be looking into this issues and any general issues that may come up related to Android 15. Will post an update when I have identified the issue and have a proposed fix

@alanleedev alanleedev self-assigned this Jul 31, 2024
@Abdelaty-magdy
Copy link

@Abdelaty-magdy @ManiTWIndia I'll be looking into this issues and any general issues that may come up related to Android 15. Will post an update when I have identified the issue and have a proposed fix

@alanleedev I did some investigation and I think the root cause is forcing the app to have edge-to-edge feature in Android 15.

@alanleedev
Copy link
Contributor

@alanleedev I did some investigation and I think the root cause is forcing the app to have edge-to-edge feature in Android 15.

@Abdelaty-magdy Do you have more details around what you found?
My investigation lead me to believe it was an issue with ModalHostHelper.getModalHostSize(). Specifically, display.getCurrentSizeRange(MIN_POINT, MAX_POINT) seems to have different results in Android 15 and the return value from the function is incorrect.
I also see some existing issues with the Modal.
I don't have a solution for this issue yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Modal Issue: Author Provided Repro This issue can be reproduced in Snack or an attached project. Type: New Architecture Issues and PRs related to new architecture (Fabric/Turbo Modules)
Projects
None yet
Development

No branches or pull requests

4 participants