fix(a11y): font size (#9395)

This commit is contained in:
William Juan
2021-05-13 22:02:34 +07:00
committed by GitHub
parent 95596e8230
commit 7a92c1646f
2 changed files with 2 additions and 2 deletions

View File

@@ -92,7 +92,7 @@ function updateCurrentHelperClasses(): void {
const oldActiveFontScaleCategory = currentFontScaleCategory;
switch (fontScaleCategory) {
case FontScaleCategory.ExtraSmall: {
currentFontScaleCategory = fontScaleMediumCategoryClass;
currentFontScaleCategory = fontScaleExtraSmallCategoryClass;
break;
}
case FontScaleCategory.Medium: {

View File

@@ -5,7 +5,7 @@ export const VALID_FONT_SCALES = global.isIOS // iOS supports a wider number of
export function getClosestValidFontScale(fontScale: number): number {
fontScale = Number(fontScale) || 1;
return VALID_FONT_SCALES.sort((a, b) => Math.abs(fontScale - a) - Math.abs(fontScale - b)).shift();
return VALID_FONT_SCALES.sort((a, b) => Math.abs(fontScale - a) - Math.abs(fontScale - b))[0];
}
export enum FontScaleCategory {