英文:
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
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中的
英文:
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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论