Skip to content

[Fabric] iOS: Fixes Switch component incorrectly renders as toggled on even though value prop is hardcoded to false #50049

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

Closed

Conversation

zhongwuzw
Copy link
Contributor

Summary:

Fixes #50026

Changelog:

[IOS] [FIXED] - [Fabric] iOS: Fixes Switch component incorrectly renders as toggled on even though value prop is hardcoded to false

Test Plan:

Repro please see #50026.

…n even though value prop is hardcoded to false
@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. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. labels Mar 16, 2025
@javache
Copy link
Member

javache commented Mar 17, 2025

This doesn't seem to be the correct fix. We can expect that after prepareForRecycle at least one updateProps: will be called. Why can't we configure the switch view there if _isInitialValueSet is false?

@zhongwuzw
Copy link
Contributor Author

This doesn't seem to be the correct fix. We can expect that after prepareForRecycle at least one updateProps: will be called. Why can't we configure the switch view there if _isInitialValueSet is false?

@javache updateProps: would be called after prepareForRecycle, but user always passed value to false so it would not trigger Switch update.

@javache
Copy link
Member

javache commented Mar 17, 2025

Ah, I assumed _isInitialValueSet could be used for this purpose, but it looks like that's mostly about animating. LGTM.

@facebook-github-bot
Copy link
Contributor

@javache has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@zhongwuzw zhongwuzw requested a review from cipolleschi March 17, 2025 14:09
Copy link
Contributor

@cipolleschi cipolleschi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for applying the feedback!

@facebook-github-bot
Copy link
Contributor

@cipolleschi has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Mar 17, 2025
@facebook-github-bot
Copy link
Contributor

@cipolleschi merged this pull request in a802be0.

@react-native-bot
Copy link
Collaborator

This pull request was successfully merged by @zhongwuzw in a802be0

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

react-native-bot pushed a commit that referenced this pull request Jun 4, 2025
…ough value prop is hardcoded to false (#50049)

Summary:
Fixes #50026

## Changelog:

[IOS] [FIXED] - [Fabric] iOS: Fixes Switch component incorrectly renders as toggled on even though value prop is hardcoded to false

Pull Request resolved: #50049

Test Plan: Repro please see #50026.

Reviewed By: javache

Differential Revision: D71307864

Pulled By: cipolleschi

fbshipit-source-id: 57238296842229cf2f23a3f44134f43e27b54609
@react-native-bot
Copy link
Collaborator

This pull request was successfully merged by @zhongwuzw in 8d42fc4

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

react-native-bot pushed a commit that referenced this pull request Jul 1, 2025
…ough value prop is hardcoded to false (#50049)

Summary:
Fixes #50026

## Changelog:

[IOS] [FIXED] - [Fabric] iOS: Fixes Switch component incorrectly renders as toggled on even though value prop is hardcoded to false

Pull Request resolved: #50049

Test Plan: Repro please see #50026.

Reviewed By: javache

Differential Revision: D71307864

Pulled By: cipolleschi

fbshipit-source-id: 57238296842229cf2f23a3f44134f43e27b54609
@react-native-bot
Copy link
Collaborator

This pull request was successfully merged by @zhongwuzw in 4ec5e99

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

fabriziocucci pushed a commit that referenced this pull request Jul 9, 2025
…ough value prop is hardcoded to false (#50049)

Summary:
Fixes #50026

## Changelog:

[IOS] [FIXED] - [Fabric] iOS: Fixes Switch component incorrectly renders as toggled on even though value prop is hardcoded to false

Pull Request resolved: #50049

Test Plan: Repro please see #50026.

Reviewed By: javache

Differential Revision: D71307864

Pulled By: cipolleschi

fbshipit-source-id: 57238296842229cf2f23a3f44134f43e27b54609
@react-native-bot
Copy link
Collaborator

This pull request was successfully merged by @zhongwuzw in 78d6092

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

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. Merged This PR has been merged. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Switch component incorrectly renders as toggled on even though value prop is hardcoded to false
5 participants