Observe content view bounds natively to update sheet height on iOS

Replace the async JS bridge round-trip (onLayout → updateLayout()) with
native KVO observation on the content view's bounds. When React Native's
Yoga layout engine sets the frame, the KVO callback fires synchronously
on the same run loop iteration and calls updateLayout() directly. This
eliminates the timing issues that surfaced after enabling iOS 26 design.

https://claude.ai/code/session_01Rp7ef1h3fKh6fhStcjqLJ5
This commit is contained in:
Claude
2026-02-28 23:47:19 +00:00
committed by Samuel Newman
parent ae2dd8432b
commit f83662275d
2 changed files with 29 additions and 2 deletions
@@ -126,9 +126,9 @@ export class BottomSheetNativeComponent extends React.Component<
// a console.log() - just sending the log to the CLI is enough.
// TODO: Get to the bottom of this and fix it properly! -sfn
setTimeout(() => this.updateLayout())
} else {
this.updateLayout()
}
// iOS: content height changes are observed natively via KVO on
// the content view's bounds, so no JS bridge round-trip needed.
}}
/>
</Portal>