react / react/react-native

Accessibility state treated incorrectly on iOS

未关闭
#45,300 4 条评论 0 个 reaction 已指派 2 人 在 GitHub 查看

@blakef 已经在做这个了。

开始于 2024年7月12日。

Accessibility Help Wanted :octocat: Issue: Author Provided Repro Platform: iOS
主要语言
C++
星标
127k
派生
25.3k
平均合并
1 天 23 小时
30 天内合并 PR
4

描述

Description

I'm seeing two strange behaviours around the disabled property and accessibilitState.disabled on iOS:

  • Setting disabled={true} on a TouchableOpacity leads to Voiceover reading the label of the touchable opacity followed by "link"
    • Even if you set role="button" and accessibilityRole="button", VoiceOver will still read out " link button"
    • In the example I've included you can see once you bump the counter up and the minus button is no longer disabled, it stops getting read out as a link
  • Whatever is set for accessibilityState.disabled is never read out. Other properties, like accessibilityState.selected are still read out

Both of these issues happen on iOS (I'm including a snack, my iOS version is 17.5.1 - I've not tested this on other iOS versions), but TalkBack correctly reads out the button role and accessibilityState.

Steps to reproduce
  1. Create a and assign it a button role and accessibilityRole
  2. Set disabled={true} on it and accessibilityState={{disabled: true}}
  3. Turn on VoiceOver and focus on the TouchableOpacity

Expected behaviour

  • The TouchableOpacity's is read out as " button disabled"

Actual behaviour

  • The TouchableOpacity is read out as " link button"
    • "disabled" is never read out
    • Removing disabled={true} leads to the component no longer being read out as a link
React Native Version

0.74.0

Affected Platforms

Runtime - iOS

Output of npx react-native info
Not applicable as developing directly in Expo Snack
Stacktrace or Logs
Not applicable as developing directly in Expo Snack
Reproducer

https://snack.expo.dev/_f-0w64MnvIqQ65myDxPW

Screenshots and Videos

No response

贡献指南

打开贡献指南

从这里开始

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

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

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