ReactJS可访问性问题VoiceOver IOS。

huangapple go评论66阅读模式
英文:

ReactJS accessibility issue Voiceover IOS

问题

我有一个位于页脚前面的 Material Button 组件。问题是当 Voiceover 聚焦在这个按钮上时,他会发音为“回到顶部按钮结束名称”。我想知道如何使 Voiceover 只发音为“回到顶部按钮”,而不是“结束名称”。我尝试使用 aria-role="none" 来隐藏按钮内的元素,还尝试了 aria-hidden,但不幸的是没有帮到我。但当我在 DOM 树中的按钮后创建了一个额外的文本元素时,Voiceover 开始在最后的文本元素上读取“结束名称”。

英文:

I have material Button component which is located before footer

ReactJS可访问性问题VoiceOver IOS。

The problem is when Voiceover focus on this button he pronounce Back to top button end name. I want to know how make that Voiceover will pronounce just Back to top button without end name.

I tried use aria-role="none" to elements inside button and also used aria-hidden unfortunately it's not help me. But when I create one more text element after button in DOM three then Voiceover starts reading end name on last text element

答案1

得分: 1

我认为你听到的是“end main”,而不是“end name”。你可以在VoiceOver中打开字幕面板,以准确了解VoiceOver说了什么(设置 > 辅助功能 > VoiceOver > 字幕面板【在底部】)。

当你导航通过“容器”元素,比如地标,其中“main”是地标的一种类型,VoiceOver会告诉用户他们已经到达了该部分的末尾。这是正确的行为,你不应该关闭它。

如果你不想让你的“回到顶部”在之后说“end main”,那么你需要将“回到顶部”元素移到DOM中的

容器之外。然而,这只会导致“end main”在另一个元素上被宣布。

英文:

I think what you are hearing is "end main", not "end name". You can turn on the captioning panel in VoiceOver to see exactly what VoiceOver says (Settings > Accessibility > VoiceOver > Caption Panel [at bottom]).

When you navigate through "container" elements, such as landmarks, of which "main" is one type of landmark, VoiceOver will tell the user when they reach the end of that section. That is correct behavior that you should not turn off.

If you don't want your "back to top" to say "end main" afterwards, then you need to move the "back to top" element outside of your <main> container in the DOM. However, that will just cause "end main" to be announced on a different element.

huangapple
  • 本文由 发表于 2023年5月10日 20:53:02
  • 转载请务必保留本文链接:https://go.coder-hub.com/76218661.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定