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:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user