-
Notifications
You must be signed in to change notification settings - Fork 491
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
font scale: setMaxContentSizeMultiplier doesn't work for RN.Text and RN.TextInput #783
Comments
This feature (a maximum size multiplier) doesn't currently exist in React Native. It's a feature that the Skype team implemented in our own private fork of RN. We've been working on getting the change integrated into React Native proper. I'm not sure of the latest status of that effort. |
I tried this function(max size multiplier) but it doesn't work. I thought it was exposed as accessibility large text, isn't it? |
Font size multiplier is exposed, but there's currently no way to cap it to a maximum value. |
I see. I want to limit the fontSizeMultipliers for thresholds. For example, make the ExtraExtraExtraLarge(3.571) to Large(2.143). Currently, it doesn't support it, right? But i feel like setMaxContentSizeMultiplier is build for it. It doesn't really work thought. Something like this: |
Oh, interesting. I missed your reference before. It looks like FB added this support to RN.IOS at some point. It wasn't added to the documentation for AccessibilityManager, but I see it in the code. Unfortunately, I don't see any similar support exposed on RN.Android. @rigdern, have you had any further conversations with FB on this topic? |
On Android, there're not that much range of multipliers. I think this is only exposed for iOS to solve the accessibility's large text mode |
For Skype, we had a problem where text could get too big as the user increased their system font scale setting. We considered using As Eric mentioned, Adam Comella |
I know it's been a while, but @rigdern do you think it would be possible to update the status of this ticket? -- I'm hoping that this is actually fixed now in react-native and we just need some PR for ReactXP. My question above also goes for you @ohyeslk -- I'd love to figure out where we're at here! |
I think this is partially implemented in or related to #1200 … does that sound right? |
Hey,
In function setMaxContentSizeMultiplier(maxContentSizeMultiplier: number): void { },
it shouldn't use UIManager.setMaxContentSizeMultiplier, we should use AccessibilityManager.setAccessibilityContentSizeMultipliers in React Native.
Something like RN.NativeModules.AccessibilityManager.setAccessibilityContentSizeMultipliers(maxContentSizeMultiplier);
But the maxContentSizeMultiplier should be a dictionary like:
const fontSizeMultipliers = {
extraSmall: 0.823,
small: 0.882,
medium: 0.941,
large: 1.0,
extraLarge: 1.118,
extraExtraLarge: 1.235,
extraExtraExtraLarge: 1.353,
accessibilityMedium: 1.786,
accessibilityLarge: 2.143,
accessibilityExtraLarge: 2.643,
accessibilityExtraExtraLarge: 3.143,
accessibilityExtraExtraExtraLarge: 3.571,
};
Here's the reference:
https://snack.expo.io/ryOh1Migb
The text was updated successfully, but these errors were encountered: