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文件才生效,这个具体原因还不知道是什么原因

相关推荐
风骏时光牛马几秒前
生成一个后端标题,只需要一个标题,不需要其他的任何文本。
前端
子非鱼@Itfuture几秒前
关于前后端联调中登录状态/登录信息失效?
java·前端
郭小李1 分钟前
openFeign入门
java·开发语言·前端
馒头不想说话10 分钟前
AI当运营,帮你省人力
前端
梦曦i29 分钟前
uni-app x下自研架构的工程化突围
前端·架构·uni-app x
速易达网络42 分钟前
ECharts 图表制作完全指南:从零到可视化实战
前端·javascript·echarts
IT_陈寒1 小时前
SpringBoot多环境配置把我坑惨了,这个踩坑经验你最好看看
前端·人工智能·后端
徐小夕1 小时前
深度剖析 30k star 的编码 Agent DeepSeek-Reasonix:长会话 Token 成本直降 80%
前端·vue.js·github
轻松西西莱尔1 小时前
谷歌+斯坦福+CMU 等五家 203 页综述,我做了个HTML把主动式AI的边界跑给你看
前端·html·agent
吴凡wudianmei1 小时前
从 0 搭一个 AI Agent(四):SSE 跑通之后,三处“契约错配”与它们的修复边界
前端·后端·aigc