react / react/react-native

[Android] Keyboard toolbar overlap

Đang mở
#51,015 4 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

API: Keyboard Issue: Author Provided Repro Platform: Android
Ngôn ngữ chính
C++
Star
127k
Fork
25.3k
Merge trung bình
1 ngày 23 giờ
Pull request đã merge (30 ngày)
4

Mô tả

Description

On Pixel, Vivo, and Xiaomi devices, the Gboard toolbar overlaps with the app's sticky button when entering generic text, making the button partially or completely inaccessible. This issue appears to be specific to certain input types and doesn't occur consistently across all text fields.

When using a street address field, the accessory bar appears, but when using a postal code field, the bar is hidden. The system doesn't trigger new keyboard events when it shows or hides this accessory bar, making it difficult to detect and adjust layouts accordingly.

The issue is reproducible when the form has fields with different input types. I.e. when the keyboard changes its height without actually hiding.

Hiding and showing the keyboard works as a workaround.

Workaround:

An ugly fix is triggering the "keyboardDidShow" event from the app approximately 400ms after focusing on the view. This means the system eventually provides the correct dimensions, but it doesn't provide them initially. There is probably no specific event for the toolbar.

Steps to reproduce
  1. Install the app yarn android
  2. Focus on the "Street Address" field
    Expected result: the sticky button is on top of the keyboard toolbar
    Result: the keyboard toolbar covers the sticky button
React Native Version

0.79.1

Affected Platforms

Runtime - Android

Output of npx @react-native-community/cli info
System:
  OS: macOS 15.4.1
  CPU: (12) arm64 Apple M2 Max
  Memory: 129.13 MB / 32.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 21.7.1
    path: ~/.nvm/versions/node/v21.7.1/bin/node
  Yarn:
    version: 1.22.22
    path: ~/.nvm/versions/node/v21.7.1/bin/yarn
  npm:
    version: 10.8.3
    path: ~/.nvm/versions/node/v21.7.1/bin/npm
  Watchman: Not Found
Managers:
  CocoaPods:
    version: 1.15.2
    path: /Users/vlad/.rvm/gems/ruby-3.1.5/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 24.0
      - iOS 18.0
      - macOS 15.0
      - tvOS 18.0
      - visionOS 2.0
      - watchOS 11.0
  Android SDK: Not Found
IDEs:
  Android Studio: 2024.3 AI-243.24978.46.2431.13208083
  Xcode:
    version: 16.0/16A242d
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.15
    path: /usr/bin/javac
  Ruby:
    version: 3.1.5
    path: /Users/vlad/.rvm/rubies/ruby-3.1.5/bin/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react: Not Found
  react-native: Not Found
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: false
  newArchEnabled: false
iOS:
  hermesEnabled: true
  newArchEnabled: false
Stacktrace or Logs
N/A
MANDATORY Reproducer

https://github.com/vladvlasov256/reproduce-android-keyboard-toolbar-issue

Screenshots and Videos

https://github.com/user-attachments/assets/48b075ff-2b84-43ec-99db-ff83388cb52f

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Bắt đầu bằng cách chạy trình tái hiện bắt buộc với yarn android và so sánh các trường Street Address và postal code trong khi thanh công cụ bàn phím xuất hiện hoặc ẩn đi. Theo dõi cách React Native xử lý bàn phím và layout của Android để xác định tại sao kích thước không được cập nhật khi chiều cao bàn phím thay đổi. Được xem là hoàn tất khi nút sticky vẫn có thể truy cập được trong lúc chuyển đổi giữa các loại trường nhập liệu bị ảnh hưởng.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
android, react-native
Lĩnh vực
mobile
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
38/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.