Skip to content

fix(android): add RootNodeKind trait for nested sheet touch handling#375

Merged
lodev09 merged 1 commit into
mainfrom
fix/android-nested-pressables
Jan 2, 2026
Merged

fix(android): add RootNodeKind trait for nested sheet touch handling#375
lodev09 merged 1 commit into
mainfrom
fix/android-nested-pressables

Conversation

@lodev09

@lodev09 lodev09 commented Jan 2, 2026

Copy link
Copy Markdown
Owner

Summary

Fixes pressables not working in nested sheets on Android real devices.

The issue was that TrueSheetViewShadowNode was missing the RootNodeKind trait. This trait is used by React Native's Fabric renderer to:

  1. Stop coordinate accumulation - In computeRelativeLayoutMetrics(), the algorithm stops at nodes with RootNodeKind, treating them as new roots for layout calculations
  2. Proper touch routing - In findNodeAtPoint(), coordinates are calculated correctly for nested views within their own coordinate space

Without this trait, nested TrueSheet components have their coordinates calculated relative to the parent sheet, which causes touch events to be routed incorrectly.

This is the same pattern used by:

  • React Native's ModalHostViewShadowNode
  • react-native-screens' RNSModalScreenShadowNode, RNSFullWindowOverlayShadowNode, and RNSSplitViewScreenShadowNode

Fixes #163

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

Test Plan

Tested nested sheets with pressables on Android real device - pressables now respond correctly.

Checklist

  • I tested on iOS
  • I tested on Android
  • I tested on Web
  • I updated the documentation (if needed)

Fixes pressables not working in nested sheets on Android real devices.
The RootNodeKind trait ensures each sheet has its own coordinate space
for touch event routing.
@vercel

vercel Bot commented Jan 2, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
react-native-true-sheet Ready Ready Preview, Comment Jan 2, 2026 11:58am

@lodev09 lodev09 merged commit 240b2a4 into main Jan 2, 2026
5 checks passed
@lodev09 lodev09 deleted the fix/android-nested-pressables branch January 2, 2026 11:58
@lodev09

lodev09 commented Jan 2, 2026

Copy link
Copy Markdown
Owner Author

🚀 This pull request is included in v3.7.0-beta.0. See Release 3.7.0-beta.0 for release notes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Android New Architecture no press event

1 participant