Documentation menu

Input and Scrolling

Translate Hera’s ordered device events into Fabric interaction while preserving target identity and accepted geometry.

The native event loop receives input as Hera server messages and routes each event to its surface session. The Fabric bridge then translates it for React Native emitters or native scroll handling, preserving the server's targeting decisions along the way.

Server Target Identity

Hera selects the surface and node using confirmed presented scene geometry. The bridge must preserve the target identity and any commit-local coordinate provenance instead of hit testing against an unrelated future shadow tree.

Event kinds carry more than a new pointer position. Button transitions, cancellation, device removal, and focus changes determine whether an interaction can continue. Preserving those transitions prevents a pressed control or gesture stream from remaining active after its owner disappears.

Ordered Touch Translation

A touch contact belongs to the target selected at Start until End or Cancel closes the stream. The native conversion must preserve both packet order and contact order so the receiving side sees cancellation before a reused contact ID establishes a new stream.

C ABI touch lists are message-owned. Copy any information that must outlive the dispatch callback and free the message resources through the matching FFI operation.

Wheel Input and Scrolling

For wheel input, the platform scroll controller updates native scroll state and emits retained mutations for content offset and clipping. It also sends Fabric-facing updates so React Native's view of the movement stays aligned with the displayed scene.

When modifying this path, verify both the visible content offset and emitted events. A display-only offset can leave JavaScript state behind; a JavaScript-only update can leave the retained server scene unchanged.

Keyboard Ownership

Keyboard delivery follows the server's surface ownership notifications before Fabric or the toolkit chooses a locally focused control. Losing surface ownership must preserve existing stream rules rather than redirecting a held key to a different surface. Local control focus remains a further decision within the receiving application.

Do not infer complete TextInput support from keyboard delivery. An editor also needs an editing model, composition, selection geometry, focus lifecycle, and a registered component implementation.

See input protocol, runtime lifecycle, and verification.

Source Reference

The following files in the Hera checkout define the behavior described on this page.

  • react-native/rn_host/src/fabric/input/input.cpp
  • react-native/rn_host/src/input/translate/input.cpp
  • react-native/rn_host/src/platform/scroll/scroll_input_controller.cpp
  • react-native/rn_host/src/platform/scroll/scroll_mutation_emitter.cpp