Skip to content

Modal组件渲染后控制台提示报错信息,"aria-hidden" 被使用到了可聚焦元素上 #7749

@BingHua017

Description

@BingHua017
  • I have searched the issues of this repository and believe that this is not a duplicate.

Version

4.2.3

Environment

chrome版本 127.0.6533.73(正式版本)(64 位)

Reproduction link

https://www.antdv.com/components/modal-cn

Steps to reproduce

  1. 使用chrome最新版本;
  2. 打开antdv组件库的modal界面;
  3. 打开console并触发页面的modal组件即可见到此报错信息;

What is expected?

预期是没有此报错信息

What is actually happening?

使用modal组件并调用后console显示如下报错信息:
Blocked aria-hidden on a <div> element because the element that just received focus must not be hidden from assistive technology users. Avoid using aria-hidden on a focused element or its ancestor. Consider using the inert attribute instead, which will also prevent focus. For more details, see the aria-hidden section of the WAI-ARIA specification at https://w3c.github.io/aria/#aria-hidden.

MDN文档关于aria-hidden的说明中提到:不要在可以获得焦点的元素上使用 aria-hidden="true"。

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions