Skip to content

Conversation

@cipolleschi
Copy link
Contributor

@cipolleschi cipolleschi commented Aug 21, 2025

Summary:

Pull Request resolved: #53247

Apple changed the sizes of the UISwitchComponent and now, if you build an iOs app using the component, the layout of the app will be broken because of wrong layout measurements.
This has been reported also by #52823

The <Switch> component was using hardcoded values for its size.
This change fixes the problem by:

  • Using codegen for interface only
  • Implementing a custom Sadow Node to ask the platform for the Switch measurements
  • Updating the JS layout to wrap the size around the native component.

Changelog:

[iOS][Fixed] - Fix Switch layout to work with iOS26

Pull Request resolved: #53067

Test Plan:
Tested locally with RNTester.

iOS Version Before After
< iOS 26
>= iOS 26

Summary:
Pull Request resolved: #53247

Apple changed the sizes of the UISwitchComponent and now, if you build an iOs app using the <Switch> component, the layout of the app will be broken because of wrong layout measurements.
This has been reported also by [https://github.com/facebook/react-native/issues/52823](https://github.com/facebook/react-native/issues/52823).

The `<Switch>` component was using hardcoded values for its size.
This change fixes the problem by:
- Using codegen for interface only
- Implementing a custom Sadow Node to ask the platform for the Switch measurements
- Updating the JS layout to wrap the size around the native component.

[iOS][Fixed] - Fix Switch layout to work with iOS26

Pull Request resolved: #53067

Test Plan:
Tested locally with RNTester.

| iOS Version | Before | After |
| --- | --- | --- |
| < iOS 26 | https://github.com/user-attachments/assets/91d73ea3-30ba-4a5c-948e-ea5c63aa7c6d | https://github.com/user-attachments/assets/76061bc8-0f14-412a-a8fb-d1c3951772e6 |
| >= iOS 26 | https://github.com/user-attachments/assets/1abc477f-bc0a-4762-938e-98814fb2a054 | https://github.com/user-attachments/assets/77e562e1-b803-46ac-9cf6-102f062a1cd4 |

Rollback Plan:

Reviewed By: sammy-SC

Differential Revision: D79653120

Pulled By: cipolleschi

fbshipit-source-id: d99b353b7b7b5496b148779de4abe3e57dd38156
@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Aug 21, 2025
@cipolleschi cipolleschi changed the base branch from main to 0.81-stable August 21, 2025 09:40
@motiz88
Copy link
Contributor

motiz88 commented Aug 27, 2025

@cipolleschi I assume we should ignore the CI failures here? (could not find compatible versions for pod "hermes-engine")

@cipolleschi
Copy link
Contributor Author

yeah, that should have required a bump in the podfile.lock...

@motiz88 motiz88 merged commit dffbfe6 into 0.81-stable Aug 27, 2025
71 of 75 checks passed
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. p: Facebook Partner: Facebook Partner Pick Request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants