Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix (ios-view): resolves race condition when setting preferredContentSize on view controller #10179

Merged
merged 3 commits into from Jan 21, 2023

Conversation

AdamAtri
Copy link
Contributor

PR Checklist

What is the current behavior?

A race condition exists when showing a view modally on ios if that view has been assigned width and height. In _showNativeModalView (@nativescript/core/ui/core/view/index.ios.ts, 459) const controller is assigned the value this.viewController. In the handler callback created on line 481, the width/height from the view are assigned to the preferredContentSize of the controller. However at the conclusion of _showNativeModalView, the controller variable is released, creating a race condition for the handler.

What is the new behavior?

Making the perferredContentSize assignment on this.viewController instead of controller avoids a race condition.

@nx-cloud
Copy link

nx-cloud bot commented Jan 19, 2023

Nx Cloud Report

CI is running for commit e52e8f9.

📂 Click to track the progress, see the status, the terminal output, and the build insights.


Sent with 💌 from NxCloud.

@cla-bot cla-bot bot added the cla: yes label Jan 19, 2023
@AdamAtri
Copy link
Contributor Author

Rock on!!! My first commit to {N} core!

@NathanWalker NathanWalker merged commit ed14e24 into NativeScript:main Jan 21, 2023
@AdamAtri AdamAtri deleted the main branch January 24, 2023 16:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants