-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
fix(ios): Missing support for a11y font scale #10207
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
fix(ios): Missing support for a11y font scale #10207
Conversation
☁️ Nx Cloud ReportCI is running/has finished running commands for commit 2689f9e. As they complete they will appear below. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this branch ✅ Successfully ran 2 targetsSent with 💌 from NxCloud. |
@CatchABus not 100% sure about perf consequences. But I think.it is always best to put that behind a property. Another reason to use a property is that components extending text-base (plugins) will also benefit from it. While if you do it in onCreateView and the plugin has its own onCreateView it won't get it. |
I think we could add an |
I've tested the changes on iOS and i'm happy to report that it does fix scaling of labels / texts - however - this PR does not fix font-scaling in buttons - its missing an adjustsFontForContentSizeCategory in ui/button/index.ios.ts when creating the native view |
It seems that using UIFontMetrics API is not a suitable option for NativeScript right now. According to a11y guidelines, an iOS developer can align views with scaled font by meddling with layout constraints mechanism, and this isn't functional in {N} right now. What we can do now is fix existing behaviour, it's like 1 or 2 missing lines to apply scale using an inherited property called |
@CatchABus on iOS you dont need to find all the necessary views and call requestLayout. Simply relayout all pages |
Yes, that was my initial thought but unfortunately it didn't work as expected since it's going up as you mentioned. You have to call We have already gotten an inherited property called I'm preparing another PR for fixing a problem related to inherited properties, then I think we can complete unfinished work for font scale. :D |
5e357f4
to
ec1a617
Compare
ec1a617
to
11cdf08
Compare
@CatchABus - thx - i'll test it out :) |
@CatchABus, i still doesn't scale text in buttons |
Strange, I have |
I'll have to double check, but I believe the added
file will prevent running the tests from
because it "overrides" it during the webpack build. Checking for |
If that test fails we’ll swap that, good mention. |
I think I might have accidentally missed this. The initial plan would be to have a common file and a blank android file that exports tests from common too. If checking for |
PR Checklist
What is the current behavior?
In iOS, fonts are not affected by device accessibility font scale settings.
What is the new behavior?
Fonts will be affected by device accessibility font scale settings.
We had a font scale implementation that actually was an incomplete work so I also performed a cleanup.
@NathanWalker For this to work, I used an API that was introduced at iOS 11. Do you think we should support older devices?
@farfromrefug Do you think this could have a performance impact? We could discuss about adding a property to make it configurable to both platforms perhaps.
Fixes https://discord.com/channels/603595811204366337/1048667697493319851