简体   繁体   English

Flex辅助功能-无法设置屏幕阅读器顺序

[英]Flex Accessibility - Cannot set screen reader order

I'm having a problem where I'm not able to set up a custom reading order for text in my Flex application. 我遇到无法在Flex应用程序中为文本设置自定义阅读顺序的问题。 I'm setting the tabIndex property on each text element, which I understand is the proper way to set the reading order for a screen reader. 我在每个文本元素上设置tabIndex属性,我知道这是设置屏幕阅读器阅读顺序的正确方法。

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
            xmlns:mx="library://ns.adobe.com/flex/mx" layout="absolute">

  <mx:Label x="10" y="10" text="1" tabIndex="2" />
  <mx:Label x="10" y="36" text="2" tabIndex="1" />
  <mx:Label x="10" y="62" text="3" tabIndex="3" />

</mx:Application>

For this small test application, the screen reader (JAWS 12) reads "1 2 3" instead of "2 1 3". 对于此小型测试应用程序,屏幕阅读器(JAWS 12)读取“ 1 2 3”而不是“ 2 1 3”。

Some testing seems to indicate that this is only a problem for my particular configuration. 一些测试似乎表明这只是我的特定配置的问题。 I am compiling the application with Flex SDK 4.1, but using the MX component set only, and the Halo theme. 我正在使用Flex SDK 4.1编译应用程序,但仅使用MX组件集和Halo主题。 We've got a fairly complex app which started out before Flex 4 was around, so while we have made the jump to compile with the latest SDK, we have not yet upgraded anything to use the Spark component set. 我们有一个相当复杂的应用程序,该应用程序在Flex 4出现之前就已经开始了,因此尽管我们已经做出了使用最新SDK进行编译的跳跃,但我们还没有升级任何东西来使用Spark组件集。

When I make a similar test app using the 4.1 SDK and the Spark components+theme, the reading order is set correctly. 当我使用4.1 SDK和Spark组件+主题制作类似的测试应用程序时,正确设置了阅读顺序。 Same result if I make a test app and compile using the 3.5 SDK - everything works. 如果我制作测试应用程序并使用3.5 SDK进行编译,则结果相同-一切正常。

I know I could switch to using Spark components, but I'm trying to avoid that if I can as it would mean timelines would have to change on the current project I'm working on. 我知道我可以切换到使用Spark组件,但是我试图避免这种情况,因为这意味着时间表必须在我正在处理的当前项目上进行更改。

Has anyone run into any similar issues, or have any suggestions that might get this to work? 有没有人遇到任何类似的问题,或者有任何建议可以解决这个问题?

You'll want to use Text instead of Label. 您将要使用文本而不是标签。 Documentation: 说明文件:

A Label control is read by a screen reader when it is associated with other controls, or when the Forms mode is inactive. 当一个Label控件与其他控件关联时,或者当Forms模式处于非活动状态时,它会被屏幕阅读器读取。 The Label control is not focusable in Forms mode, or by the keyboard. Label控件在“表单”模式下或键盘上无法聚焦。

... ...

A Text control is not focusable and is read by screen readers only when Forms mode is inactive. 文本控件不可聚焦,并且只有在“表单”模式处于非活动状态时,屏幕阅读器才能读取它。

I also found this which might be a better solution. 我还发现这可能是一个更好的解决方案。 The example is in Flex 4, but you can do the same with Label in Flex 3, just need to implement the IFocusManagerComponent interface. 该示例在Flex 4中进行,但是您可以对Flex 3中的Label进行相同操作,只需实现IFocusManagerComponent接口。

Im working with JAWS 11 in Flex 3 at the moment, so havnt had that problem yet. 目前,我正在Flex 3中使用JAWS 11,因此还没有遇到这个问题。 But, i've read about one option of putting copies of the components offstage, its too complicated for our needs, and letting the screen reader just read these components in order: 但是,我已经读过一种选择,可以将组件的副本放到舞台上,这对于我们的需求而言太复杂了,让屏幕阅读器按顺序读取这些组件:

http://www.adobe.com/accessibility/products/flash/reading.html#off_stage http://www.adobe.com/accessibility/products/flash/reading.html#off_stage

Also, a trick I saw was to set the TabIndex in increments of 10. JAWs only cares about their order, and if you need to add extra components, you wont need to renumber everything. 另外,我看到的一个技巧是将TabIndex设置为10。JAW只关心它们的顺序,如果需要添加额外的组件,则不需要重新编号。 ie 10, 20, 30 then if you need you can add 11, rather than renumbering everything. 即10、20、30,然后根据需要添加11,而不是重新编号。

Brian 布赖恩

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM