Accessiiblity inspector warnings about Dynamic Type font sizes are unsupported
#1625
pylapp
started this conversation in
Return of experience and feedbacks
Replies: 2 comments
Another sampleThanks @karlcosse Text(text)
.multilineTextAlignment(.leading)
.padding(
.horizontal,
horizontalSizeClass == .compact ? theme.spaces.scaledMediumMobile : theme.spaces.scaledMediumTablet
)
.padding(.bottom, theme.spaces.fixedMedium)
.headingSmall(theme) // <------ view modifier called here (@pylapp)
.foregroundColor(theme.colors.contentDefault)
.frame(alignment: .leading)
.accessibilityHidden(true)and inspector warning: |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Context
With Xcode it is possible to use the developer tool Accessibility Inspector to run accessibility audits for apps.
Users notified us some warnings occur about Dynamic Type:
Dynamic Type font size are unsupported.Detailed message is
User will not be able to change the font size of this SwiftUI.AccessibilityNode.However, the items for which these warnings are sent manages
Dynamic Type.Indeed in the
TypographyModifierview modifier, the line height is scaled like (see Swift source file):We reproduced the warning in the design system toolbox (see Swift source file), even for a text with this modifier behind:
calling
using in the end
Suggestion
Maybe, as suggested by reporter, use another API. Instead of
UIFontMetrics.default.scaledValue(for:)we should tryrelativeTo:orscaledFont(for:).Thanks reporter @karlcosse!
Resources
Accessibility inspector warning
Target text on design system toolbox app
Dynamic rendering
ScreenRecording_07-16-2026.11-55-18_1.MP4
All reactions