Mac“ VoiceOver”正在访问模式框下方的内容

问题描述 投票:1回答:1

即使选项卡导航仅限于模式框,Mac“ VoiceOver”仍会访问模式框下方的内容。 NVDA没有这个问题。下面的链接来自W3。此页面中的示例也有问题。

Modal Dialog Example

我不知道该功能是默认还是实际问题。有人可以确认吗?

javascript html macos accessibility voiceover
1个回答
1
投票

可悲的是,这是一个持续存在的问题(VoiceOver错误/设计决定),尽管尝试了许多破解和变通办法,但是似乎很难有效解决。

[我最终为解决这个在100%的时间内有效的方法是将aria-hidden="true"应用于主要内容,然后将模式保留在主要内容之外。

<section class="container">
    <div class="your-content" aria-hidden="true">
        //main content, hidden when modal is opened via aria-hidden.
        //This should be the main container for the page that holds EVERYTHING else other than your modal
    </div>
    <div class="modal">
        //modal content, with all of your existing constraints in place to stop tabbing outside etc.   
    </div>
</section>  
© www.soinside.com 2019 - 2024. All rights reserved.