react / react/react-native

Accessibility Issue: Dynamic type fontsizes are unsupported

未关闭
#51,612 7 条评论 2 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

Needs: Triage :mag:
主要语言
C++
星标
127k
派生
25.3k
平均合并
1 天 23 小时
30 天内合并 PR
4

描述

Description

We are trying to fix all accessibility issues on our app, and noticed this warning with textinput with iOS Accessibility Inspector while running on audit

allowFontScaling={true} has no effect on this warning

<View style={{flex: 1, backgroundColor: '#fff'}}> <TextInput style={{padding: 20}} placeholder="Type here..." allowFontScaling={true}></TextInput> </View> </View>

How can we remove this warning?

Steps to reproduce
  1. Run the below sample application on iOS simulator or a real device
  2. Select 'Accessibility inspector' from Xcode developer tools
  3. Run an audit on the screen
  4. Will get the below error for text input
    " Dynamic Text font sizes are unsupported. User will not be able to change the font size of this element"

Is there anything missing here?

React Native Version

0.79.2

Affected Platforms

Runtime - iOS

Output of npx @react-native-community/cli info
System:
  OS: macOS 15.5
  CPU: (11) arm64 Apple M3 Pro
  Memory: 113.31 MB / 18.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 20.15.1
    path: ~/.nvm/versions/node/v20.15.1/bin/node
  Yarn:
    version: 1.22.22
    path: /opt/homebrew/bin/yarn
  npm:
    version: 10.7.0
    path: ~/.nvm/versions/node/v20.15.1/bin/npm
  Watchman:
    version: 2025.02.10.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.16.2
    path: /opt/homebrew/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 24.4
      - iOS 18.4
      - macOS 15.4
      - tvOS 18.4
      - visionOS 2.4
      - watchOS 11.4
  Android SDK: Not Found
IDEs:
  Android Studio: 2024.1 AI-241.18034.62.2411.12071903
  Xcode:
    version: 16.3/16E140
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.12
    path: /usr/bin/javac
  Ruby:
    version: 2.6.10
    path: /usr/bin/ruby
npmPackages:
  "@react-native-community/cli":
    installed: 18.0.0
    wanted: 18.0.0
  react:
    installed: 19.0.0
    wanted: 19.0.0
  react-native:
    installed: 0.79.2
    wanted: 0.79.2
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: true
iOS:
  hermesEnabled: true
  newArchEnabled: true
Stacktrace or Logs
NA
MANDATORY Reproducer

https://github.com/anoopmm/accessibility.git

Screenshots and Videos

Image

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

从必需的复现用例开始,并使用 issue 中描述的 iOS Accessibility Inspector 审计来运行其 TextInput 示例。跟踪 React Native 0.79.2 如何处理 iOS TextInput 的 allowFontScaling,然后验证报告的 „Dynamic Text font sizes“ 警告已得到解决,同时不会使示例行为发生回归。

由索引模型根据 Issue 内容生成。

评估

技术栈
react-native
领域
accessibility, mobile
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
冷清
描述清晰度
需要澄清
新手友好度
38/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。