React-native-paper: Checkbox invisible when unchecked on iOS

Created on 1 Mar 2019  路  10Comments  路  Source: callstack/react-native-paper


Current behaviour

On iOS an unchecked checkbox is invisible, which is not user friendly. Additionally, the uncheckedColor prop is not implemented on iOS.

Expected behaviour

By default the checkbox should be visible. uncheckedColor should be implemented on iOS, or at least in the documentation it should be mentioned that this prop is Android-only.

Code sample

The code as provided in the documentation

Screenshots (if applicable)

What have you tried

What I tried (and what I think is also the most logical course of action) is to use the uncheckedColor prop to change the color of an unticked checkbox. However this is not implemented on iOS.

Your Environment

| software | version
| --------------------- | -------
| ios or android |
| react-native |
| react-native-paper |
| node |
| npm or yarn |
| expo sdk |

Stale enhancement good first task

Most helpful comment

You can always use <Checkbox.Android /> to just use the Android properties (ie. outlined unchecked box) on iOS devices.

All 10 comments

Same thing I have been trying to modify an IOS uncheck color

According to this doc , there is no problem at all. but I agree with you :). https://material.io/design/platform-guidance/cross-platform-adaptation.html#cross-platform-guidelines

Hmm, ok so this should be an issue on the material design language then... How shall we proceed?

@abaart for iOS, they usually prefer the switch component when building layouts. It could be a good idea to display it conditionally e.g. Platform.OS === 'ios' ? Switch : Checkbox

related: #390

Docs should call out that iOS ignores this prop. Would also like to see the ability to set an unchecked color on iOS and/or border/customize the icon.

You can always use <Checkbox.Android /> to just use the Android properties (ie. outlined unchecked box) on iOS devices.

Hello 馃憢, this issue has been open for more than 2 months with no activity on it. If the issue is still present in the latest version, please leave a comment within 7 days to keep it open, otherwise it will be closed automatically. If you found a solution on workaround for the issue, please comment here for others to find. If this issue is critical for you, please consider sending a pull request to fix the issue.

Just wanna note that RadioButton has the same issue. And apply @adteague also works too but code may look confusing for others...

You can always use <Checkbox.Android /> to just use the Android properties (ie. outlined unchecked box) on iOS devices.

Thank it works

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ButuzGOL picture ButuzGOL  路  4Comments

zxccvvv picture zxccvvv  路  4Comments

sm2017 picture sm2017  路  4Comments

knobandre picture knobandre  路  4Comments

scottybo picture scottybo  路  3Comments