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

Reset the autoresizing mask when the view is recycled #43215

Closed
wants to merge 1 commit into from

Conversation

cipolleschi
Copy link
Contributor

Summary:
Autoresizing mask is a native property of iOS views. When a veiw is created anew, the default value is UIViewAutoresizingNone. Libraries might create code that update this property and we need to make sure that it is reset when the view is recycled.

This should close: #42732

Changelog:

[iOS][Changed] - Reset the autoresizing mask to UIViewAutoresizingNone when the view is recycled.

Differential Revision: D54263847

Summary:
Autoresizing mask is a native property of iOS views. When a veiw is created anew, the default value is `UIViewAutoresizingNone`. Libraries might create code that update this property and we need to make sure that it is reset when the view is recycled.

This should close: facebook#42732

## Changelog:
[iOS][Changed] - Reset the autoresizing mask to `UIViewAutoresizingNone` when the view is recycled.

Differential Revision: D54263847
@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. p: Facebook Partner: Facebook Partner labels Feb 27, 2024
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D54263847

@cipolleschi
Copy link
Contributor Author

@j-piasecki This should address one of the issue you opened last month, sorry for the delay.

One thing I noticed is that the React state in the app in this specific example goes out of sync with this change.
What I mean is that:

  • we enable autoresizing mask to be width and height (the second state is true)
  • we recycle the view tapping on the first button
  • the autoresize mask is now None, and the view behaves properly as if it was none, but the react state is still W+H set to true.

Are we ok with this? I don't think there is a way to propagate this change up to the JS layer, right?

Before the change, not resetting the autoresizeMask would have avoided this problem, because the autoresizeMask is not reset and the state is not reset, so it stays consistent. What would be the ideal behavior?

@cipolleschi
Copy link
Contributor Author

closing, not the right fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported p: Facebook Partner: Facebook Partner
Projects
None yet
Development

Successfully merging this pull request may close these issues.

UIView properties are not reset to default values when recycled
2 participants