You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Mac VoiceOver在Safari/Firefox切换时不播报aria-expanded状态变更(Chrome正常)

VoiceOver下aria-expanded状态变更播报的浏览器差异问题

Mac VoiceOver在Chrome中可正常播报aria-expanded的展开/收起状态变更,但在Safari和Firefox中存在异常:切换按钮状态时,VoiceOver不会实时播报状态变化,仅当通过Tab键重新聚焦到按钮时,才会正确读出“Collapsed”或“Expanded”。

问题复现代码

<div role="group">
  <button aria-controls="id" type="button" href="#" aria-expanded="true">
    <div>Button</div>
  </button>
  <div id="id">
    <div role="list">
      <label role="listitem">
        <input>
        <span>text</span>
      </label>
    </div>
  </div>
</div>

操作场景与现象

  • 已为按钮添加点击监听器用于切换aria-expanded属性,功能逻辑正常。
  • Chrome中:VoiceOver聚焦按钮后按control+option+space切换状态,每次状态变更都会被实时播报,符合预期。
  • Safari和Firefox中:执行相同操作时,即使调试工具显示aria-expanded属性已变更,VoiceOver仍不会播报状态变化,只有重新聚焦按钮时才会读取当前状态。

额外观察

发现部分网站的aria-expanded状态在Chrome和Safari中均可被VoiceOver正常播报,但在Firefox中依然存在相同异常,推测这可能是浏览器对aria-expanded属性的兼容性问题。


内容的提问来源于stack exchange,提问作者ywbk

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.20 22:25:20