vue项目使用element-ui中的radio,切换radio时报错: Blocked aria-hidden

vue项目使用element-ui中的radio,切换radio时报错:

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.

后面上网查找的时候发现是浏览器的原因。

使用如下样式可以解决:

javascript 复制代码
/deep/ .el-radio__original {
  display: none !important; /* 隐藏原生 radio 输入,但仍然允许交互 */
}
 
/deep/.el-radio:focus:not(.is-focus):not(:active):not(.is-disabled) .el-radio__inner {
    box-shadow: none !important;
}

因为项目中有很多radio单选按钮,所以我写到全局样式中,但是出现了一个问题用scss全局引入时不生效,改成css文件才生效,这个具体原因还不知道是什么原因

相关推荐
LIO31 分钟前
Axios Token 无感刷新机制:原理、实现与最佳实践
前端·axios
「已注销」40 分钟前
面试分享:二本靠7轮面试成功拿下大厂P6
前端·javascript·面试
Lee川41 分钟前
深入浅出:用 React 打造高性能懒加载无限滚动组件
前端·react.js
walking9571 小时前
重新学习前端之JavaScript
前端·vue.js·面试
walking9571 小时前
重新学习前端之HTML
前端·vue.js·面试
walking9571 小时前
重新学习前端之Vue
前端·vue.js·面试
牛奶1 小时前
开发者的"奇技淫巧":那些让你效率翻倍的实战技巧
前端·后端·程序员
咸鱼翻身更入味1 小时前
Vue创建一个简单的Agent聊天——工具调用
前端
Timo来了1 小时前
indexDB的用法示例
前端
泉城老铁1 小时前
springboot实现word转换pdf
vue.js·后端