Fix missing onCloseHandler in CustomerCenterProxy#1581
Draft
facumenzella wants to merge 1 commit into
Draft
Conversation
…n to be a no-op on iOS 15 When onCloseHandler is nil, CustomerCenterView falls back to SwiftUI's dismiss() environment action. On iOS 15, calling dismiss() at the root of a NavigationView is a no-op, so the Customer Center close button has no effect when presentCustomerCenter() is used. Setting onCloseHandler to call vc.dismiss(animated: true) ensures UIKit properly dismisses the modal on all iOS versions, triggering viewDidDisappear with isBeingDismissed=true and notifying the delegate. Fixes CC-647 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CustomerCenterProxy.createCustomerCenterViewController()never setonCloseHandleron theCustomerCenterUIViewControllerit createdonCloseHandlerisnil,CustomerCenterViewfalls back to SwiftUI's@Environment(\.dismiss)actiondismiss()at the root of aNavigationViewis a no-op (there's even a comment inDismissCircleButtoncalling this out explicitly)presentCustomerCenter()on iOS 15The fix sets
onCloseHandlerto callvc.dismiss(animated: true), which:viewDidDisappearwithisBeingDismissed = truecustomerCenterViewControllerWasDismissedon the delegate → resolves the RN/Flutter/etc. PromiseNote: the embedded
CustomerCenterViewManageralready setonCloseHandlercorrectly — this only affected the modal proxy path.Test plan
presentCustomerCenter()on iOS 15 device/simulatoronDismissfiresFixes CC-647
🤖 Generated with Claude Code