react / react/react-native

[Android] Element with position: absolute is incorrectly marked as not visible to the user if it's rendered outside of parent

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

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

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

When using UI automation suite like Maestro, on Android it uses AccessibilityNodeInfo isVisibleToUser method to determine if the element is visible to the user and clickable.

Despite an element rendered with position: absolute and no overflow: hidden on the parent being visible on the screen, the isVisibleToUser flag is incorrectly set to false if the element is outside of the bounds of the parent, causing E2E test to fail (mobile-dev-inc/maestro#1609)

Steps to reproduce

Clone the repro repository first.

To reproduce the issue:

  1. Install the packages with yarn or npm
  2. Open Android emulator
  3. Run yarn android / npm run android
  4. Make sure the app is visible
  5. Press on the dropdown to open it

Then:

  1. Install maestro locally
  2. Run maestro -p android test maestro.yml and see the test fail
  3. Run maestro hierarchy and see that the dropdown items are not visible in the output

See details

React Native Version

0.79.2

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: 166.94 MB / 32.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 20.13.1
    path: ~/.asdf/installs/nodejs/20.13.1/bin/node
  Yarn:
    version: 1.22.22
    path: ~/.asdf/installs/nodejs/20.13.1/bin/yarn
  npm:
    version: 10.5.2
    path: ~/.asdf/installs/nodejs/20.13.1/bin/npm
  Watchman:
    version: 2025.04.28.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.15.2
    path: /Users/matyas/.asdf/shims/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 24.4
      - iOS 18.4
      - macOS 15.4
      - tvOS 18.4
      - visionOS 2.4
      - watchOS 11.4
  Android SDK:
    API Levels:
      - "33"
      - "33"
      - "34"
    Build Tools:
      - 30.0.3
      - 33.0.0
      - 33.0.2
      - 34.0.0
      - 34.0.0
    System Images:
      - android-33 | Google APIs ARM 64 v8a
      - android-34 | Google APIs ARM 64 v8a
      - android-36 | Google Play ARM 64 v8a
    Android NDK: Not Found
IDEs:
  Android Studio: 2023.2 AI-232.10300.40.2321.11668458
  Xcode:
    version: 16.3/16E140
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: javac 17
    path: /Users/matyas/.asdf/shims/javac
  Ruby:
    version: 3.2.3
    path: /Users/matyas/.asdf/shims/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 19.0.0
    wanted: 19.0.0
  react-native:
    installed: 0.79.2
    wanted: 0.79.2
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: Not found
  newArchEnabled: Not found
iOS:
  hermesEnabled: Not found
  newArchEnabled: Not found
Stacktrace or Logs
(no stack trace)
MANDATORY Reproducer

https://github.com/d4rky-pl/PositionAbsoluteBug

Screenshots and Videos

The app
Image

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 với reproducer bắt buộc của PositionAbsoluteBug và kiểm tra đầu ra trợ năng của Android cho dropdown được render bên ngoài phần tử cha của nó. Truy vết cách AccessibilityNodeInfo.isVisibleToUser được xác định trong trường hợp này, sau đó xác minh rằng các mục dropdown xuất hiện trong maestro hierarchy và test Maestro có thể tương tác với chúng mà không có overflow hidden.

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
accessibility, 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
45/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.