Skip to content

Conversation

@cipolleschi
Copy link
Contributor

@cipolleschi cipolleschi commented Aug 18, 2025

Summary:
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

Differential Revision: D80454350

Test Plan

iOS Version Before After
< iOS 26
>= iOS 26

@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 18, 2025
@facebook-github-bot
Copy link
Contributor

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

@facebook-github-bot
Copy link
Contributor

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

cipolleschi added a commit to cipolleschi/react-native that referenced this pull request Aug 18, 2025
Summary:
Pull Request resolved: facebook#53326

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.

## Changelog:

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

Differential Revision: D80454350
@facebook-github-bot
Copy link
Contributor

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

cipolleschi added a commit to cipolleschi/react-native that referenced this pull request Aug 18, 2025
Summary:
Pull Request resolved: facebook#53326

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.

## Changelog:

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

Differential Revision: D80454350
@facebook-github-bot
Copy link
Contributor

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

cipolleschi added a commit to cipolleschi/react-native that referenced this pull request Aug 18, 2025
Summary:
Pull Request resolved: facebook#53326

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.

## Changelog:

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

Differential Revision: D80454350
cipolleschi added a commit to cipolleschi/react-native that referenced this pull request Sep 3, 2025
Summary:

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.

## Changelog:

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

Reviewed By: sammy-SC

Differential Revision: D80454350
@facebook-github-bot
Copy link
Contributor

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

Summary:

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.

## Changelog:

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

Reviewed By: sammy-SC

Differential Revision: D80454350
@facebook-github-bot
Copy link
Contributor

@cipolleschi has exported this pull request. If you are a Meta employee, you can view the originating diff in D80454350.

@facebook-github-bot
Copy link
Contributor

This pull request has been merged in 91d427f.

@react-native-bot
Copy link
Collaborator

This pull request was successfully merged by @cipolleschi in 91d427f

When will my fix make it into a release? | How to file a pick request?

vzaidman pushed a commit that referenced this pull request Sep 22, 2025
Summary:
Pull Request resolved: #53326

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.

## Changelog:

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

Reviewed By: sammy-SC

Differential Revision: D80454350

fbshipit-source-id: 1d468910276f7fde4559d2ae87cf60c8494caceb
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 Merged This PR has been merged. meta-exported p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants