You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -56,29 +57,30 @@ type CheckboxProps = Partial<ChildrenProps> & {
56
57
57
58
/** Additional styles to add to checkbox wrapper */
58
59
wrapperStyle?: StyleProp<ViewStyle>;
60
+
61
+
/** Reference to the outer element */
62
+
ref?: ForwardedRef<View>;
59
63
};
60
64
61
-
functionCheckbox(
62
-
{
63
-
isChecked =false,
64
-
isIndeterminate =false,
65
-
hasError =false,
66
-
disabled =false,
67
-
style,
68
-
containerStyle,
69
-
children =null,
70
-
onMouseDown,
71
-
containerSize =20,
72
-
containerBorderRadius =4,
73
-
caretSize =14,
74
-
onPress,
75
-
accessibilityLabel,
76
-
shouldStopMouseDownPropagation,
77
-
shouldSelectOnPressEnter,
78
-
wrapperStyle,
79
-
}: CheckboxProps,
80
-
ref: ForwardedRef<View>,
81
-
){
65
+
functionCheckbox({
66
+
isChecked =false,
67
+
isIndeterminate =false,
68
+
hasError =false,
69
+
disabled =false,
70
+
style,
71
+
containerStyle,
72
+
children =null,
73
+
onMouseDown,
74
+
containerSize =20,
75
+
containerBorderRadius =4,
76
+
caretSize =14,
77
+
onPress,
78
+
accessibilityLabel,
79
+
shouldStopMouseDownPropagation,
80
+
shouldSelectOnPressEnter,
81
+
wrapperStyle,
82
+
ref,
83
+
}: CheckboxProps){
82
84
consttheme=useTheme();
83
85
conststyles=useThemeStyles();
84
86
constStyleUtils=useStyleUtils();
@@ -117,7 +119,7 @@ function Checkbox(
117
119
}
118
120
onMouseDown?.(e);
119
121
}}
120
-
ref={ref}
122
+
ref={refasPressableRef}
121
123
style={[StyleUtils.getCheckboxPressableStyle(containerBorderRadius+2),style]}// to align outline on focus, border-radius of pressable should be 2px more than Checkbox
0 commit comments