react / react/react-native

Android) Switch track is not visible when it is disabled and the parent has a dark background

Open
#30,446 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Component: Switch Issue: Author Provided Repro Platform: Android
Dominant language
C++
Stars
127k
Forks
25.3k
Avg merge
1d 23h
Merged PRs (30d)
4

Description

Description

Switch doesn't display the track if:

  • It is an Android device
  • Switch has disabled={true}
  • Container background is black

Expected Results

Switch should display the track with a gray color

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

snack: https://snack.expo.io/@rubengt01/switch-with-dark-background
screenshot:
Screenshot_20201120-184049_Expo

react-native info

System:
OS: macOS 11.0.1
CPU: (8) x64 Intel(R) Core(TM) i7-4870HQ CPU @ 2.50GHz
Memory: 168.31 MB / 16.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 12.18.4 - ~/.nvm/versions/node/v12.18.4/bin/node
Yarn: 1.22.5 - /usr/local/bin/yarn
npm: 6.9.2 - ~/.nvm/versions/node/v12.18.4/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.9.3 - /Users/Ruben/.rvm/rubies/ruby-2.6.1/bin/pod
SDKs:
iOS SDK:
Platforms: iOS 14.2, DriverKit 20.0, macOS 11.0, tvOS 14.2, watchOS 7.1
Android SDK: Not Found
IDEs:
Android Studio: 4.0 AI-193.6911.18.40.6626763
Xcode: 12.2/12B45b - /usr/bin/xcodebuild
Languages:
Java: 14.0.2 - /usr/bin/javac
Python: 2.7.16 - /usr/local/bin/python
npmPackages:
@react-native-community/cli: Not Found
react: 16.13.1 => 16.13.1
react-native: 0.63.3 => 0.63.3
react-native-macos: Not Found
npmGlobalPackages:
react-native: Not Found

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the disabled Switch case from the linked Expo Snack on Android with a black parent background. Trace the React Native Android Switch entry point and compare the disabled track rendering with the expected gray track. Done means the track remains visible in gray under those conditions.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, react-native
Domain
mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.