首页 前端知识 AntDsign Vue弹窗报错:Blocked aria-hidden on an element because its descendant retained focus.

AntDsign Vue弹窗报错:Blocked aria-hidden on an element because its descendant retained focus.

2025-03-09 15:03:30 前端知识 前端哥 342 266 我要收藏

使用
在这里插入图片描述
Blocked aria-hidden on an element because its descendant retained focus. The 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.
Element with focus: div
Ancestor with aria-hidden: <div tabindex=​"0" aria-hidden=​"true" style=​"width:​ 0px;​ height:​ 0px;​ overflow:​ hidden;​">​​

解决办法

this.jz.visible = true;
            this.$nextTick(() => {
                const domArr = document.getElementsByClassName('ant-modal');
                if(domArr && domArr.length>0) {
                    Array.from(domArr).forEach(item =>{
                        if (item.childNodes && item.childNodes.length >0){
                            Array.from(item.childNodes).forEach(child => {
                                if(child.setAttribute){
                                    child.setAttribute('aria-hidden','false');
                                }
                            })
                        }
                    })
                }
            });
转载请注明出处或者链接地址:https://www.qianduange.cn//article/23010.html
标签
评论
发布的文章

Autoware安装教程

2025-03-09 15:03:40

【C 】map详解

2025-03-09 15:03:37

大家推荐的文章
会员中心 联系我 留言建议 回顶部
复制成功!