react / react/react-native

Android: Keyboard cutoff in landscape mode when edge-to-edge is enabled (notch side clipped)

未关闭
#53,851 3 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

API: Keyboard Needs: Triage :mag: Platform: Android
主要语言
C++
星标
127k
派生
25.3k
平均合并
1 天 23 小时
30 天内合并 PR
4

描述

Description

After enabling edge-to-edge , the Android keyboard gets cut off on the notch side in landscape orientation.

In LANDSCAPE_LEFT, the left side is clipped (behind the notch).

In LANDSCAPE_RIGHT, the right side is clipped.

In portrait, the keyboard displays correctly.

This happens regardless of using KeyboardAvoidingView, SafeAreaProvider, or adjustResize.

Steps to reproduce
  1. Create a new React Native project.
  2. Enable edge-to-edge
  3. Add a TextInput and focus it.
  4. Rotate the device to landscape.
React Native Version

0.81.4

Affected Platforms

Runtime - Android

Output of npx @react-native-community/cli info
System:
  OS: macOS 14.7.5
  CPU: (8) arm64 Apple M1
  Memory: 109.77 MB / 16.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 23.11.0
    path: /opt/homebrew/bin/node
  Yarn:
    version: 1.22.22
    path: /opt/homebrew/bin/yarn
  npm:
    version: 10.9.2
    path: /opt/homebrew/bin/npm
  Watchman:
    version: 2025.04.14.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.16.2
    path: /opt/homebrew/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 24.2
      - iOS 18.2
      - macOS 15.2
      - tvOS 18.2
      - visionOS 2.2
      - watchOS 11.2
  Android SDK: Not Found
IDEs:
  Android Studio: 2024.3 AI-243.24978.46.2431.13363775
  Xcode:
    version: 16.2/16C5032a
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.15
    path: /usr/bin/javac
  Ruby:
    version: 2.6.10
    path: /usr/bin/ruby
npmPackages:
  "@react-native-community/cli":
    installed: 20.0.0
    wanted: 20.0.0
  react:
    installed: 19.1.0
    wanted: 19.1.0
  react-native:
    installed: 0.81.4
    wanted: 0.81.4
  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
MANDATORY Reproducer

https://github.com/Prajwaltechversant/orientationturbodummy

Screenshots and Videos
Image Image

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

https://github.com/Prajwaltechversant/orientationturbodummy 这个必需的 reproducer 开始,启用 edge-to-edge,让一个 TextInput 获得焦点,然后在 Android 上旋转到横屏。比较 LANDSCAPE_LEFT 和 LANDSCAPE_RIGHT 的行为;完成的标准是键盘在 notch 一侧不再被裁切,同时竖屏行为保持正确。

由索引模型根据 Issue 内容生成。

评估

技术栈
android, react-native
领域
mobile
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
活跃
描述清晰度
基本清楚
新手友好度
52/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。