Skip to content

[Switch] Font truncated a11y issue fix #2644

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

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "fix switch font ally",
"packageName": "@fluentui-react-native/switch",
"email": "rohanpd.work@gmail.com",
"dependentChangeType": "patch"
}
3 changes: 3 additions & 0 deletions packages/experimental/Switch/src/Switch.styling.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ export const switchStates: (keyof SwitchTokens)[] = [
'disabled',
];

const isMobile = Platform.OS === 'android' || Platform.OS === 'ios';

export const stylingSettings: UseStylingOptions<SwitchProps, SwitchSlotProps, SwitchTokens> = {
tokens: [defaultSwitchTokens, switchName],
states: switchStates,
Expand Down Expand Up @@ -103,6 +105,7 @@ export const stylingSettings: UseStylingOptions<SwitchProps, SwitchSlotProps, Sw
(tokens: SwitchTokens, theme: Theme) => ({
style: {
color: tokens.color,
...(isMobile && { flexShrink: 1 }),
...fontStyles.from(tokens, theme),
},
}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ exports[`Switch Default 1`] = `
style={
Object {
"color": "#242424",
"flexShrink": 1,
"fontFamily": "Segoe UI",
"fontSize": 13,
"fontWeight": "400",
Expand Down Expand Up @@ -177,6 +178,7 @@ exports[`Switch Disabled 1`] = `
style={
Object {
"color": "#e0e0e0",
"flexShrink": 1,
"fontFamily": "Segoe UI",
"fontSize": 13,
"fontWeight": "400",
Expand Down