我的网站有几位用户向我解释说,无法再点击复选框或单击“添加文件”按钮(input type file)
在更新Google Chrome浏览器到版本92.0.4515.107之前,我无法复现这个问题
我发现我的一个CSS类覆盖了默认参数,因为Google Chrome将我的输入视为只读输入。
https://jsfiddle.net/Lfjctwb1/
示例:
<div class="form-check">
<input class="form-check-input" type="checkbox" id="confirm-checkbox" required="">
<label class="form-check-label" for="confirm-checkbox">
<strong>I confirm</strong>
</label>
</div>
<br>
<br>
<input type="file" name="my_file" required />
我覆盖的 CSS 类:
.disabled, input:read-only {
pointer-events: none;
}
如何修改我的类而不必修改所有的输入?
:read-only
。@Rocstar,也许你可以使用[readonly]
选择器代替:read-only
。另外,你真的需要那个类吗? - vanowm<input>
也存在同样的问题。 - vanowm