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

相关推荐
David凉宸1 分钟前
Vue 3 项目的性能优化策略:从原理到实践
前端·vue.js·性能优化
小马_xiaoen9 分钟前
Proxy 与 Reflect 从入门到实战:ES6 元编程核心特性详解
前端·javascript·ecmascript·es6
hoiii18719 分钟前
MATLAB SGM(半全局匹配)算法实现
前端·算法·matlab
计算机学姐1 小时前
基于SpringBoot的民宿预定管理系统【三角色+个性化推荐算法+数据可视化统计】
java·vue.js·spring boot·mysql·信息可视化·intellij-idea·推荐算法
LeoZY_1 小时前
开源项目精选:Dear ImGui —— 轻量高效的 C++ 即时模式 GUI 框架
开发语言·c++·ui·开源·开源软件
Betelgeuse761 小时前
【Flutter For OpenHarmony】TechHub技术资讯界面开发
flutter·ui·华为·交互·harmonyos
会编程的土豆1 小时前
新手前端小细节
前端·css·html·项目
广州华水科技2 小时前
单北斗GNSS在桥梁形变监测中的应用与技术进展分析
前端
我讲个笑话你可别哭啊2 小时前
鸿蒙ArkTS快速入门
前端·ts·arkts·鸿蒙·方舟开发框架
CherryLee_12102 小时前
基于poplar-annotation前端插件封装文本标注组件及使用
前端·文本标注