react-native icon indicating copy to clipboard operation
react-native copied to clipboard

Switch component background color issue when value is false

Open eng-naveed opened this issue 2 years ago • 1 comments

Description

Expected behavior:

When the Switch component value is false, the background color should remain white.

Actual behavior:

When the Switch component value is false, the background color appears to be grey instead of white.

Additional information:

Expected Screenshot 2023-06-15 at 6 17 08 PM

Actual Screenshot 2023-06-15 at 6 17 44 PM

React Native Version

0.70.6

Output of npx react-native info

n/a

Steps to reproduce

  1. Create a new React Native project.
  2. Add a Switch component to a screen or component.
  3. Set the background color of the Switch component to white.
  4. Test the Switch component by toggling its value between true and false.

Snack, code example, screenshot, or link to a repository

<Switch trackColor={{false: '#ffffff', true: '#ffffff'}} thumbColor={isEnabled ? '#EAC041' : '#C7C7C7'} ios_backgroundColor="#ffffff" onValueChange={toggleSwitch} value={isEnabled} style={{backgroundColor: 'white'}}/>

eng-naveed avatar Jun 15 '23 13:06 eng-naveed

:warning: Newer Version of React Native is Available!
:information_source: You are on a supported minor version, but it looks like there's a newer patch available - 0.70.10. Please upgrade to the highest patch for your minor or latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If it does not repro, please let us know so we can close out this issue. This helps us ensure we are looking at issues that still exist in the most recent releases.

github-actions[bot] avatar Jun 15 '23 13:06 github-actions[bot]

This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] avatar Dec 13 '23 05:12 github-actions[bot]

This issue was closed because it has been stalled for 7 days with no activity.

github-actions[bot] avatar Dec 20 '23 05:12 github-actions[bot]