简体   繁体   English

在ember中将屏幕阅读器的焦点设置为模态警报

[英]Setting focus of a screen reader on a modal alert in ember

I am attempting to make my ember.js app more accessible and am doing my testing via Apple's built-in VoiceOver utility. 我试图让我的ember.js应用程序更容易访问,并通过Apple的内置VoiceOver实用程序进行测试。 I'm adding ariaRoles as necessary to my views and tacking on aria-label attributes where the purpose of navigation is unclear. 我正在根据我的观点添加ariaRoles并添加导航目的不明确的aria-label属性。 I'm having issues getting the focus on modal alerts, as the reader's focus stays on the page items behind the modal. 我在关注模态警报时遇到了问题,因为读者的注意力集中在模态背后的页面项上。 Does anyone have experience handling focus on modal alerts for screen readers? 有没有人有经验处理专注于屏幕阅读器的模态警报? I'm under the impression that declaring "ariaRole:'alertDialog'" in my view sets the appropriate role for such a dialog, and it is possible that the focus behavior for this role differs between screen readers. 我的印象是在我的视图中声明“ariaRole:'alertDialog'”为这样的对话设置了适当的角色,并且这个角色的焦点行为可能在屏幕阅读器之间有所不同。 Thanks!!! 谢谢!!!

I don't have first hand experience with modal stuff. 我对模态的东西没有第一手经验。 Essentially your issue is you are throwing on an ARIA role, and kind of expect it to work. 基本上你的问题是你正在投入ARIA角色,并期望它能够发挥作用。 You need to do more than that. 你需要做的不仅仅是这些。 You need to keep the following in mind: 您需要牢记以下几点:

  • Once the link/button is pressed, move focus to the modal window/dialog/popup. 按下链接/按钮后,将焦点移至模态窗口/对话框/弹出窗口。 Most modal elements are simply a <div> . 大多数模态元素只是一个<div> You can give the <div> an attribute of tabindex="-1" . 您可以为<div>提供tabindex="-1"的属性。
  • Trap focus inside the modal window. 陷阱焦点在模态窗口内。
  • Allow the user to press escape to close 允许用户按下escape以关闭
  • When closed, move focus back to link/button 关闭时,将焦点移回链接/按钮

Resources 资源

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 屏幕阅读器 - 仅阅读具有 role="alert" 而不是焦点的元素 - Screen reader - Only read element with role="alert" and not on focus 打开后如何将屏幕阅读器焦点更改为 vuetify 模态? - How to change screen reader focus to vuetify modal once it opens? 在 HTML 和 JavaScript 中设置屏幕阅读器(对讲)的初始焦点 - Setting the Screen reader(talkback)'s initial focus in HTML and JavaScript 如何防止屏幕阅读器焦点(不是指键盘焦点)离开预定义区域(例如,模态) - How to prevent screen reader focus (not referring to keyboard focus) from leaving predefined area (e.g., modal) 屏幕阅读器和HTML文档重点 - Screen reader and HTML document focus NVDA屏幕阅读器无法预测切换到对焦模式 - NVDA screen reader not switching to focus mode predictably 在屏幕阅读器上工作的空闲超时警告模式 - Idle timeout warning modal working on screen reader Javascript:关闭模态并且焦点不会返回到屏幕 - Javascript: Close Modal and the focus not return to the screen NVDA屏幕阅读器无法读取Chrome中的Javascript Alert()弹出窗口 - NVDA Screen Reader not reading Javascript Alert() Popup in Chrome 如何使屏幕阅读器专注于段落内的锚标记 - How to make screen reader focus on an anchor tag which is inside a paragraph
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM