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

发布于 2024-11-01 07:38:23 字数 936 浏览 1 评论 0原文

我遇到一个问题,无法在 Flex 应用程序中为文本设置自定义阅读顺序。我在每个文本元素上设置 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>

对于这个小型测试应用程序,屏幕阅读器 (JAWS 12) 读取“1 2 3”而不是“2 1 3”。

一些测试似乎表明这只是我的特定配置的问题。我正在使用 Flex SDK 4.1 编译应用程序,但仅使用 MX 组件集和 Halo 主题。我们有一个相当复杂的应用程序,它是在 Flex 4 出现之前就开始的,因此虽然我们已经使用最新的 SDK 进行了编译,但我们还没有升级任何东西来使用 Spark 组件集。

当我使用 4.1 SDK 和 Spark 组件+主题制作类似的测试应用程序时,读取顺序设置正确。如果我制作一个测试应用程序并使用 3.5 SDK 进行编译,结果相同 - 一切正常。

我知道我可以改用 Spark 组件,但如果可以的话我会尽量避免这种情况,因为这意味着我正在处理的当前项目的时间表必须改变。

有没有人遇到任何类似的问题,或者有任何可能让它发挥作用的建议?

I'm having a problem where I'm not able to set up a custom reading order for text in my Flex application. 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.

<?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".

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. 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.

When I make a similar test app using the 4.1 SDK and the Spark components+theme, the reading order is set correctly. Same result if I make a test app and compile using the 3.5 SDK - everything works.

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.

Has anyone run into any similar issues, or have any suggestions that might get this to work?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

横笛休吹塞上声 2024-11-08 07:38:24

您需要使用文本而不是标签。文档:

屏幕读取标签控件
与关联时的阅读器
其他控件,或者当表单模式
处于非活动状态。标签控件不是
可在表单模式下聚焦,或通过
键盘。

...

文本控件不可聚焦,并且
仅当表单时由屏幕阅读器读取
模式处于非活动状态。

我还发现了这个,这可能是一个更好的解决方案。示例是在 Flex 4 中,但是您可以对 Flex 3 中的 Label 执行相同的操作,只需实现 IFocusManagerComponent 接口即可。

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. The Label control is not
focusable in Forms mode, or by the
keyboard.

...

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.

若水微香 2024-11-08 07:38:24

我目前在 Flex 3 中使用 JAWS 11,所以还没有遇到这个问题。但是,我读过一种将组件副本放在后台的选项,这对于我们的需求来说太复杂了,并且让屏幕阅读器按顺序读取这些组件:

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

另外,我看到了一个技巧是以 10 为增量设置 TabIndex。JAW 只关心它们的顺序,如果您需要添加额外的组件,则无需对所有内容重新编号。即 10、20、30,然后如果需要,可以添加 11,而不是重新编号所有内容。

布莱恩

Im working with JAWS 11 in Flex 3 at the moment, so havnt had that problem yet. 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

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. i.e. 10, 20, 30 then if you need you can add 11, rather than renumbering everything.

Brian

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文