-
Notifications
You must be signed in to change notification settings - Fork 138
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
<Switch> property 'ios_backgroundcolor' yields inconsistent results, other color properties do not work at all #2132
Comments
So indeed, the native macOS switch doesn't support stuff like track and thumb color and I think background color only works because of undefined behavior. See the macOS switch: https://developer.apple.com/documentation/appkit/nsswitch |
So Switch is setting the color manually inside Switch.JS: ios_backgroundColor == null
? null
: {
backgroundColor: ios_backgroundColor,
borderRadius: 16,
},
), And if I understand correctly, the main issue is that you're not seeing the border radius? I'm slightly more convinced I should stub this out for macOS and not let you set a color at all, given it feels kind of hacky.. Can I ask what the use case of a custom background color on switches is? |
If you want a customizable Switch, perhaps FluentUI React Native Switch (which is all JS) may work better for you: https://github.com/microsoft/fluentui-react-native/blob/main/packages/components/Switch/SPEC.md |
documentation for this library is horrific to nonexistent... almost 100% of the example code omits the import { Checkbox } from '@fluentui/react-native'; works w/a deprecation warning but import { Switch } from '@fluentui/react-native'; fails as does import { Switch } from '@fluentui-react-native/switch'; which is copied straight from the FluentUI test project. |
it's opaque (blue) when it's switched to the "on" position but close to invisible when it's in the "off" position. the screenshots i sent in the last few messages all show the switch in the "off" position. |
Environment
Steps to reproduce the bug
Setting up a
<Switch>
element withios_backgroundcolor
property gives me different looking output seemingly at random as i minimize and activate the window (I'm using anNSPopover
). It seems like I sometimes get the correct looking output (see screenshot) the first time I open theNSPopover
but then it goes to the square outlilne (see "the other sreenshot") and never comes back:Adding
thumbColor
andtrackColor
properties (which are documented for iOS) seems to do absolutely nothing:Expected Behavior
It should at least be consistent, but ideally more like this screenshot than the other screenshot:
Actual Behavior
The other screenshot:
Reproducible Demo
Additional context
No response
The text was updated successfully, but these errors were encountered: