From 66809af783ac0242e8cf8164cd7bb6f53fe8b08f Mon Sep 17 00:00:00 2001 From: Yoan Pratama Putra Date: Mon, 27 Apr 2020 11:39:31 +0700 Subject: [PATCH] feat(exoflex): supports a11y for checkbox (#464) --- packages/exoflex/src/components/Checkbox.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/exoflex/src/components/Checkbox.tsx b/packages/exoflex/src/components/Checkbox.tsx index 0c361ba9b..67816aaac 100644 --- a/packages/exoflex/src/components/Checkbox.tsx +++ b/packages/exoflex/src/components/Checkbox.tsx @@ -6,13 +6,14 @@ import { TouchableOpacity, View, ViewStyle, + AccessibilityProps, } from 'react-native'; import Text from './Text'; import { DefaultTheme } from '../constants/themes'; import useTheme from '../helpers/useTheme'; import Check from './svg/Check'; -export type CheckboxProps = { +export type CheckboxProps = AccessibilityProps & { /** * The text/string for the checkbox */ @@ -62,11 +63,17 @@ export default function Checkbox(props: CheckboxProps) { textStyle, style, testID, + accessibilityRole, + accessibilityState, + ...otherAccessibilityProps } = props; let { colors, roundness, style: themeStyle } = useTheme(); return ( onPress(!checked)} disabled={disabled}