Skip to content

Commit 7bfe8d5

Browse files
[Checkbox] Documentation and tester update for checkbox on Android (#2444)
* doc updates for checkbox * Change files * types doc update * update spec for android unsupported props * Change files * checkbox android completion
1 parent 404f9dc commit 7bfe8d5

File tree

5 files changed

+38
-9
lines changed

5 files changed

+38
-9
lines changed

apps/fluent-tester/src/TestComponents/CheckboxExperimental/CheckboxTest.tsx

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ const OtherCheckbox: React.FunctionComponent = () => {
5959
setisChecked(false);
6060
}, []);
6161

62-
const memoizedStyles = React.useMemo(() => (Platform.OS === 'android' ? { ...mobileStyles.containerSpacedEvenly, height: 200 } : {}), []);
62+
const memoizedStyles = React.useMemo(() => (Platform.OS === 'android' ? { ...mobileStyles.containerSpacedEvenly, height: 150 } : {}), []);
6363

6464
return (
6565
<View style={memoizedStyles}>
@@ -71,8 +71,12 @@ const OtherCheckbox: React.FunctionComponent = () => {
7171
</Button>
7272

7373
<Checkbox label="This is a controlled Checkbox" checked={isChecked} />
74-
<Checkbox label="Checkbox rendered with labelPosition 'before' (controlled)" labelPosition="before" checked={isChecked} />
75-
<Checkbox label="A required checkbox with other required text" required="**" />
74+
{Platform.OS !== 'android' && (
75+
<>
76+
<Checkbox label="Checkbox rendered with labelPosition 'before' (controlled)" labelPosition="before" checked={isChecked} />
77+
<Checkbox label="A required checkbox with other required text" required="**" />
78+
</>
79+
)}
7680
</View>
7781
);
7882
};
@@ -193,10 +197,13 @@ const checkboxSections: TestSection[] = [
193197
name: 'Other Implementations',
194198
component: OtherCheckbox,
195199
},
196-
{
197-
name: 'Token Customized Checkboxes',
198-
component: TokenCheckbox,
199-
},
200+
Platform.select({
201+
android: null,
202+
default: {
203+
name: 'Token Customized Checkboxes',
204+
component: TokenCheckbox,
205+
},
206+
}),
200207
{
201208
name: 'E2E Testing for Experimental Checkbox',
202209
component: E2ECheckboxExperimentalTest,
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "patch",
3+
"comment": "update spec for android unsupported props",
4+
"packageName": "@fluentui-react-native/checkbox",
5+
"email": "[email protected]",
6+
"dependentChangeType": "patch"
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "patch",
3+
"comment": "doc updates for checkbox",
4+
"packageName": "@fluentui-react-native/tester",
5+
"email": "[email protected]",
6+
"dependentChangeType": "patch"
7+
}

packages/components/Checkbox/SPEC.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ export interface CheckboxProps extends Omit<IViewProps, 'onPress'> {
195195
*
196196
* @default after
197197
* @platform win32
198+
* Note: 'before' is not supported for Android
198199
*/
199200
labelPosition?: 'before' | 'after';
200201

@@ -214,6 +215,7 @@ export interface CheckboxProps extends Omit<IViewProps, 'onPress'> {
214215
*
215216
* @default square
216217
* @platform iOS, windows, win32
218+
* Note : 'circular' is not supported on Android
217219
*/
218220
shape?: CheckboxShape;
219221

@@ -227,6 +229,7 @@ export interface CheckboxProps extends Omit<IViewProps, 'onPress'> {
227229
/**
228230
* Provides a tooltip while hovering over Checkbox component
229231
* @platform win32
232+
* Note: Not supported for Android
230233
*/
231234
tooltip?: string;
232235
}
@@ -302,6 +305,7 @@ export interface CheckboxTokens extends FontTokens, IForegroundColorTokens, IBac
302305
/**
303306
* States that can be applied to a Checkbox.
304307
* These can be used to modify styles of the Checkbox when under the specified state.
308+
* Note: 'hovered','focused','circular','labelIsBefore','large' are not supported for Android
305309
*/
306310
disabled?: CheckboxTokens;
307311
label?: CheckboxTokens;

packages/components/Checkbox/src/Checkbox.types.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ export interface CheckboxTokens extends FontTokens, IForegroundColorTokens, IBac
7474
/**
7575
* States that can be applied to a checkbox
7676
* These can be used to modify styles of the Checkbox when under the specified state.
77+
* Note: 'hovered','focused','circular','labelIsBefore','large' are not supported for Android
7778
*/
7879
disabled?: CheckboxTokens;
7980
label?: CheckboxTokens;
@@ -128,7 +129,7 @@ export interface CheckboxProps extends Omit<IViewProps, 'onPress'> {
128129

129130
/**
130131
* Allows you to set the checkbox to be at the before (start) or after (end) the label
131-
*
132+
* Note: 'before' is not supported for Android
132133
* @default after
133134
*/
134135
labelPosition?: 'before' | 'after';
@@ -148,7 +149,8 @@ export interface CheckboxProps extends Omit<IViewProps, 'onPress'> {
148149
* The shape of the checkbox. Can be either (rounded) square or circular.
149150
*
150151
* @default square
151-
* @platform Android, iOS, windows, win32
152+
* @platform iOS, windows, win32
153+
* Note : 'circular' is not supported on Android
152154
*/
153155
shape?: CheckboxShape;
154156

@@ -160,6 +162,7 @@ export interface CheckboxProps extends Omit<IViewProps, 'onPress'> {
160162

161163
/**
162164
* Provides a tooltip while hovering over Checkbox component
165+
* Note: Not supported for Android
163166
*/
164167
tooltip?: string;
165168
}
@@ -177,6 +180,7 @@ export interface CheckboxState extends PressableState {
177180

178181
/**
179182
* Determines position of Checkbox. True if labelPosition is set to 'before'
183+
* Note : Not supported on Android
180184
*/
181185
labelIsBefore?: boolean;
182186
}

0 commit comments

Comments
 (0)