chrome input type file 不工作

346 阅读1分钟

问题:最近偶发 <input type="file" /> 没法打开弹窗的问题。

环境:Mac Chrome 116。

结论:chrome bug。

规避方法:

  • 重新打开 tab,或者刷新,或者重启 Chrome 可解决。
  • 升级 Chrome

代码如下,非常简单,原生代码也会有问题。

<input type="file" />

于是也去 antd 翻了下,果然 antd 也提到了此问题。

ant-design.antgroup.com/components/…

google 了下蛮多人遇到了问题,都没有个结论。

结论认定为 chrome 的 bug,没法彻底解决。