Flex Accessibility - Tab Focus 不再适用于 Flex 应用程序
在可访问的 Flex 应用程序中,用户可以使用 TAB 键在控件中导航。
用户激活特定链接后,Flex 应用程序会弹出在 html 页面顶部,并使用 swfobject.embedSWF 加载。
在大多数情况下它工作得很好,但在某些情况下,这些情况之一或两者都会发生:
a) Flex 应用程序加载正常,“flex focus”设置在介绍文本标签上以大声朗读,但按 Tab 似乎仍然循环浏览后面页面上的链接。 (现在已修复,请参阅编辑 2)
b) 焦点效果很好,按下 Tab 键可以循环浏览控件,但在浏览它们之后,它会从 Flex 应用程序中跳出并转到地址栏上。甚至尝试在不点击 Flex 应用程序的情况下返回它都成为一场噩梦......这并不完全是可访问性友好的。
有什么办法可以防止这些情况发生吗?
编辑:目标浏览器是 IE。似乎是 Jaws 最常用的
编辑:我设法解决了问题 (a)。诀窍是在 swf 对象上调用焦点,但稍稍超时后 - 一定与 flash/js 就绪状态有关。
setTimeout(function(){
document.getElementById('swfobject').focus()
},25);
问题(b)仍然是一个问题......
In an accessible flex app, the user can navigate through the control by using the TAB key.
The flex app pops up on top of the html page aftert the user activate a particular link, and is loaded using swfobject.embedSWF.
It works well in most cases, but there are some instances where either or both these happen:
a) The flex app loads ok, the "flex focus" is set on the intro text label to read out loud, but pressing tab seems to still cycle through the links on the page behind. (Now Fixed, see Edit 2)
b) The focus worked well and pressing tab cycle through the controls ok, but after going through them it then tabs out of the flex app and onto the address bar.. it becomes a nightmare to even try to get back to the flex app without clicking on it.. which isn't exactly accessibility friendly.
Is there any way to prevent these from happening?
EDIT: The target browser is IE. Seems to be the most used with Jaws
EDIT: I managed to fix problem (a). The trick was to call focus on the swf object, but after a slight time out - must be something to do with flash/js ready state.
setTimeout(function(){
document.getElementById('swfobject').focus()
},25);
Problem (b) is still an issue though...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在您的 mx:Application 组件中,为 keyFocusChange 添加事件侦听器并添加以下代码:
In your mx:Application component, add an event listener for the keyFocusChange and add this code :
b) 尝试在 html 中的 swf 之后放置一些可聚焦的元素。当焦点离开 Flex 应用程序时,查看该元素的 onfocus 处理程序是否被调用。如果是,您可以从那里重新聚焦 Flex 应用程序或将其重定向到您想要的位置。
b) Try to place some focusable element after swf in html. When focus leaves flex app, see if onfocus handler of that element gets called. If it is, you can refocus flex app from there or redirect it where you want.