mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
fix(a11y): font size (#9395)
This commit is contained in:
@@ -92,7 +92,7 @@ function updateCurrentHelperClasses(): void {
|
||||
const oldActiveFontScaleCategory = currentFontScaleCategory;
|
||||
switch (fontScaleCategory) {
|
||||
case FontScaleCategory.ExtraSmall: {
|
||||
currentFontScaleCategory = fontScaleMediumCategoryClass;
|
||||
currentFontScaleCategory = fontScaleExtraSmallCategoryClass;
|
||||
break;
|
||||
}
|
||||
case FontScaleCategory.Medium: {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user