怎样才能让我的模态的声音越过焦点?

问题描述

我使用的是 Mac 并且打开了旁白(辅助功能)选项。我在单击链接时打开了退出模式,并将键盘焦点设置在模式上(使用 js)。这一切正常。但是,超焦的声音并没有切换到我的模态,它仍然在触发链接上。

我如何让声音过焦点到模态?这是模态代码

<div class="modal-pattern" id="modal-1" aria-hidden="true" data-analytics-location="modal-1">
    <div class="modal-container">
        <div class="modal-icons-enabled" aria-label="modal-state" role="dialog" tabindex="-1">
            <button class="-close--small" aria-label="Close" data-analytics-click="Close [X] Modal" data-analytics-type="button" data-dismiss="x-close">
              <img src="assets/images/icon-close.svg" alt="" />Close
            </button>
            <div class="modal-header">
                <p class="modal-title">Modal</p>
            </div>
            <div class="modal-content">
                <p>Modal content.</p>
            </div>
        </div>
    </div>
</div>

另外,我知道如果键盘焦点不在键盘可以自然聚焦的元素上,那么旁白光标将不会在模态内移动。 所以我认为一种解决方案是在模式打开时将键盘焦点放在关闭按钮上。 但我不知道我该怎么办。 你能帮我什么?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)