单击 react-bootstrap 下拉列表中的文件输入不会打开浏览器的“打开文件”对话框

Clicking on file input in a react-bootstrap Dropdown does not open the borwser's Open file dialog

我想将 <input type=file/> 字段放入 bootstrap DropDown 组件中。它呈现正确,但如果我点击它,它不会打开浏览器的本机文件选择器。

我怀疑当我点击它时输入组件可能会被重新渲染,所以文件选择器没有机会 运行,但据我所知没有重新渲染发生渲染。

看下面的例子:

https://jsfiddle.net/0hmtkhpg/144/

阻止事件冒泡:

<input type=file onClick={(e) => e.stopPropagation()}/>